Merge lp:~faubulous/inkscape/cmake-win32 into lp:~inkscape.dev/inkscape/trunk

Proposed by jazzynico
Status: Merged
Merge reported by: Patrick Storz
Merged at revision: not available
Proposed branch: lp:~faubulous/inkscape/cmake-win32
Merge into: lp:~inkscape.dev/inkscape/trunk
Diff against target: 872 lines (+510/-143) (has conflicts)
10 files modified
AUTHORS (+2/-0)
CMakeLists.txt (+277/-46)
CMakeScripts/ConfigPaths.cmake (+146/-2)
CMakeScripts/DefineDependsandFlags.cmake (+21/-66)
build/configure.bat (+9/-0)
build/touch.bat (+4/-0)
config.h.cmake (+8/-0)
mingwenv.bat (+2/-2)
src/CMakeLists.txt (+41/-26)
touch.bat (+0/-1)
Text conflict in CMakeLists.txt
Contents conflict in configure.bat
Text conflict in src/CMakeLists.txt
To merge this branch: bzr merge lp:~faubulous/inkscape/cmake-win32
Reviewer Review Type Date Requested Status
Jon A. Cruz Needs Fixing
Review via email: mp+293202@code.launchpad.net

Description of the change

Just to get a diff with lp:inkscape to ease testing.

To post a comment you must log in.
Revision history for this message
jazzynico (jazzynico) wrote :

Just tried it on Windows 7 with the win32 build env (32-bit devlibs and TDM-GCC-4.6). Some comments (note that I'm a cmake newbie):
1. CMake doesn't use GS_BIN when already set (in my mingwenv.bat). It instead tries to add /bin to GS_PATH. Note that some files (pdf2ps.bat) in GS_PATH/lib need to be in GS_BIN too so that related extensions work as expected.
2. Why did you define DEVLIBS_PATH and MINGW_PATH in configure.bat? They are already defined in mingwenv.bat (with some additional paths).
3. I used -G "MSYS Makefiles" to run cmake from the MSYS shell. Cmake worked fine, but then 'make' failed when linking to the libinkscape_base shared library.
4. Then I tried -G "MinGW Makefiles" from a Windows console. Same linking problem.

That said, it's a very interesting improvement (I never managed to use cmake with the win32 build env. before!). Thanks!

Revision history for this message
jazzynico (jazzynico) wrote :

> 'make' failed when linking to the libinkscape_base shared library.

Correction. Not when linking to, but when linking the libinkscape_base.dll lib, with the following errors:
----
d:/dev/tdm-gcc-32-4.6/bin/../lib/gcc/mingw32/4.6.1/../../../../mingw32/bin/ld.exe: cannot find -lpangocairo-1.0
... same line with different libs here ...
d:/dev/tdm-gcc-32-4.6/bin/../lib/gcc/mingw32/4.6.1/../../../../mingw32/bin/ld.exe: cannot find -lsigc-2.0
collect2: ld returned 1 exit status
mingw32-make[2]: *** [lib/libinkscape_base.dll] Error 1
mingw32-make[1]: *** [src/CMakeFiles/inkscape_base.dir/all] Error 2
mingw32-make: *** [all] Error 2
----

Revision history for this message
Jon A. Cruz (jon-joncruz) wrote :

I'll have to finish reconciling with my local work, but the cmake files themselves do need some adjustment.

There are several lines that have been duplicated into if/else Windows blocks when adjusting to use the proper variables would allow a single line to be shared for all platforms.

review: Needs Fixing
lp:~faubulous/inkscape/cmake-win32 updated
14868. By Sebastian Faubel

Detecting changes in the build environment in configure.bat

14869. By Sebastian Faubel

Configure script detects changes in the build environment and resets PATH accordingly.
Bugfix: Compile errors when trailing slash or backslash is missing from GS_PATH.

Revision history for this message
Sebastian Faubel (faubulous) wrote :

Dear Jon,

it seems that the 0.92 release is getting closer. Is there any progress
with CMake on Windows?

~Sebastian

*Semiodesk GmbH | *Werner-von-Siemens-Str. 6 Geb. 15k, 86159 Augsburg,
Germany | Phone: +49 821 8854401 | Fax: +49 821 8854410 | www.semiodesk.com

This e-mail message may contain confidential or legally privileged
information and is intended only for the use of the intended recipient(s).
Any unauthorized disclosure, dissemination, distribution, copying or the
taking of any action in reliance on the information herein is prohibited.
E-mails are not secure and cannot be guaranteed to be error free as they
can be intercepted, amended, or contain viruses. Anyone who communicates
with us by e-mail is deemed to have accepted these risks. Semiodesk GmbH is
not responsible for errors or omissions in this message and denies any
responsibility for any damage arising from the use of e-mail. Any opinion
and other statement contained in this message and any attachment are solely
those of the author and do not necessarily represent those of the company.

2016-04-28 15:37 GMT+02:00 Jon A. Cruz <email address hidden>:

> Review: Needs Fixing
>
> I'll have to finish reconciling with my local work, but the cmake files
> themselves do need some adjustment.
>
> There are several lines that have been duplicated into if/else Windows
> blocks when adjusting to use the proper variables would allow a single line
> to be shared for all platforms.
> --
> https://code.launchpad.net/~faubulous/inkscape/cmake-win32/+merge/293202
> You are the owner of lp:~faubulous/inkscape/cmake-win32.
>

lp:~faubulous/inkscape/cmake-win32 updated
14870. By Sebastian Faubel

Inkscape can now be built using other shells and without invoking configure.bat
Moved Windows environment variables into ConfigPaths.cmake

14871. By Sebastian Faubel

Locales and app icon are now working.

14872. By Sebastian Faubel

Fixed generation of config.h

14873. By Sebastian Faubel

Removed BR options from CMakeLists.txt as they are optional.

Revision history for this message
Patrick Storz (ede123) wrote :

I think most of these changes have already been merged (not directly, though), notably revisions 14855, 15011 and 15024.

If there is anything in here that we still want please let us know!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'AUTHORS'
2--- AUTHORS 2016-02-27 17:38:36 +0000
3+++ AUTHORS 2016-06-28 06:54:18 +0000
4@@ -172,3 +172,5 @@
5 Daniel Yacob
6 David Yip
7 Masatake Yamato
8+Moritz Eberl
9+Sebastian Faubel
10\ No newline at end of file
11
12=== modified file 'CMakeLists.txt'
13--- CMakeLists.txt 2016-06-10 15:45:22 +0000
14+++ CMakeLists.txt 2016-06-28 06:54:18 +0000
15@@ -7,12 +7,59 @@
16 message("Binary Dir: ${CMAKE_CURRENT_BINARY_DIR}")
17
18 # -----------------------------------------------------------------------------
19+# Set platform defaults (originally copied from darktable)
20+# -----------------------------------------------------------------------------
21+include(CMakeScripts/ConfigPaths.cmake)
22+
23+if(WIN32)
24+ message("-- Windows build detected, setting default features")
25+
26+ list(INSERT CMAKE_SYSTEM_INCLUDE_PATH 0 ${DEVLIBS_PATH})
27+ list(INSERT CMAKE_SYSTEM_LIBRARY_PATH 0 ${DEVLIBS_PATH})
28+
29+ set(CMAKE_C_COMPILER "${MINGW_BIN}/gcc.exe")
30+ set(CMAKE_C_LINK_EXECUTABLE "${MINGW_BIN}/gcc.exe")
31+ set(CMAKE_CXX_COMPILER "${MINGW_BIN}/g++.exe")
32+ set(CMAKE_CXX_LINK_EXECUTABLE "${MINGW_BIN}/g++.exe")
33+ set(CMAKE_CXX_STANDARD 11)
34+
35+ # Setup Windows resource files compiler.
36+ set(CMAKE_RC_COMPILER "${MINGW_BIN}/windres.exe")
37+ set(CMAKE_RC_COMPILER_INIT windres)
38+ enable_language(RC)
39+ set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff -i <SOURCE> -o <OBJECT>")
40+
41+ # These options are required for having i18n support on Windows.
42+ option(ENABLE_NLS "Compile with i18n enabled" ON)
43+ option(HAVE_BIND_TEXTDOMAIN_CODESET "Compile with 'bind_textdomain_codeset' function" ON)
44+endif(WIN32)
45+
46+if(APPLE)
47+ message("-- Mac OS X build detected, setting default features")
48+ # prefer macports and/or user-installed libraries over system ones
49+ #LIST(APPEND CMAKE_PREFIX_PATH /opt/local /usr/local)
50+ set(CMAKE_FIND_FRAMEWORK "LAST")
51+
52+ # test and display relevant env variables
53+ if(DEFINED ENV{CMAKE_PREFIX_PATH})
54+ message("CMAKE_PREFIX_PATH: $ENV{CMAKE_PREFIX_PATH}")
55+ endif()
56+ if(DEFINED ENV{GTKMM_BASEPATH})
57+ message("GTKMM_BASEPATH: $ENV{GTKMM_BASEPATH}")
58+ endif()
59+
60+ # detect current GTK+ backend
61+ pkg_check_variable(gtk+-2.0 target)
62+ message("GTK2 backend: ${GTK+_2.0_TARGET}")
63+endif()
64+
65+# -----------------------------------------------------------------------------
66 # CMake Configuration
67 # -----------------------------------------------------------------------------
68 list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeScripts/Modules")
69
70 # avoid having empty buildtype
71-set(CMAKE_BUILD_TYPE_INIT "Release")
72+set(CMAKE_BUILD_TYPE_INIT "Debug")
73
74 project(inkscape)
75
76@@ -41,29 +88,6 @@
77 include(CMakeScripts/HelperFunctions.cmake)
78
79 # -----------------------------------------------------------------------------
80-# Set platform defaults (originally copied from darktable)
81-# -----------------------------------------------------------------------------
82-if(APPLE)
83- message("-- Mac OS X build detected, setting default features")
84- # prefer macports and/or user-installed libraries over system ones
85- #LIST(APPEND CMAKE_PREFIX_PATH /opt/local /usr/local)
86- set(CMAKE_FIND_FRAMEWORK "LAST")
87-
88- # test and display relevant env variables
89- if(DEFINED ENV{CMAKE_PREFIX_PATH})
90- message("CMAKE_PREFIX_PATH: $ENV{CMAKE_PREFIX_PATH}")
91- endif()
92- if(DEFINED ENV{GTKMM_BASEPATH})
93- message("GTKMM_BASEPATH: $ENV{GTKMM_BASEPATH}")
94- endif()
95-
96- # detect current GTK+ backend
97- pkg_check_variable(gtk+-2.0 target)
98- message("GTK2 backend: ${GTK+_2.0_TARGET}")
99-
100-endif(APPLE)
101-
102-# -----------------------------------------------------------------------------
103 # Redirect output files
104 # -----------------------------------------------------------------------------
105 set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin CACHE INTERNAL "" )
106@@ -91,6 +115,7 @@
107 option(WITH_NLS "Compile with Native Language Support (using gettext)" ON)
108 option(WITH_GTK3_EXPERIMENTAL "Enable compilation with GTK+3 (EXPERIMENTAL!)" OFF)
109
110+<<<<<<< TREE
111 # -----------------------------------------------------------------------------
112 # Test Harness
113 # -----------------------------------------------------------------------------
114@@ -105,10 +130,11 @@
115 endif()
116
117 include(CMakeScripts/ConfigPaths.cmake) # Installation Paths
118+=======
119+>>>>>>> MERGE-SOURCE
120 include(CMakeScripts/DefineDependsandFlags.cmake) # Includes, Compiler Flags, and Link Libraries
121 include(CMakeScripts/HelperMacros.cmake) # Misc Utility Macros
122
123-
124 # -----------------------------------------------------------------------------
125 # BAD HACKS, NEED TO INVESTIGATE MAKING THESE LESS BAD
126 add_definitions(-D_FORTIFY_SOURCE=2)
127@@ -116,9 +142,11 @@
128 add_definitions(-DHAVE_CONFIG_H)
129 add_definitions(-DHAVE_CAIRO_PDF=1) # needed for src/libnrtype/Layout-TNG.h
130 add_definitions(-DHAVE_TR1_UNORDERED_SET) # XXX make an option!
131+
132 if(NOT WIN32)
133 add_definitions(-fPIC)
134 endif()
135+
136 #
137 # end badness
138 # -----------------------------------------------------------------------------
139@@ -156,27 +184,29 @@
140 # -----------------------------------------------------------------------------
141 # Man pages
142 # -----------------------------------------------------------------------------
143-include("CMakeScripts/Pod2man.cmake")
144-
145-# Load AUTHORS file contents into $INKSCAPE_AUTHORS
146-file(READ ${CMAKE_CURRENT_SOURCE_DIR}/AUTHORS content)
147-string(REGEX REPLACE "^([^\n#]+)\n" "\\1;\n" content_list "${content}")
148-join(INKSCAPE_AUTHORS "," "${content_list}")
149-
150-foreach(podfile
151- man/inkscape.pod
152- man/inkscape.de.pod
153- man/inkscape.el.pod
154- man/inkscape.fr.pod
155- man/inkscape.ja.pod
156- man/inkscape.sk.pod
157- man/inkscape.zh_TW.pod
158- man/inkview.pod)
159- set(POD_IN ${CMAKE_CURRENT_SOURCE_DIR}/${podfile}.in)
160- set(POD_OUT ${CMAKE_CURRENT_BINARY_DIR}/${podfile})
161- configure_file(${POD_IN} ${POD_OUT})
162- pod2man(${POD_OUT} ${INKSCAPE_VERSION} 1 "Inkscape Commands Manual")
163-endforeach()
164+if(UNIX)
165+ include("CMakeScripts/Pod2man.cmake")
166+
167+ # Load AUTHORS file contents into $INKSCAPE_AUTHORS
168+ file(READ ${CMAKE_CURRENT_SOURCE_DIR}/AUTHORS content)
169+ string(REGEX REPLACE "^([^\n#]+)\n" "\\1;\n" content_list "${content}")
170+ join(INKSCAPE_AUTHORS "," "${content_list}")
171+
172+ foreach(podfile
173+ man/inkscape.pod
174+ man/inkscape.de.pod
175+ man/inkscape.el.pod
176+ man/inkscape.fr.pod
177+ man/inkscape.ja.pod
178+ man/inkscape.sk.pod
179+ man/inkscape.zh_TW.pod
180+ man/inkview.pod)
181+ set(POD_IN ${CMAKE_CURRENT_SOURCE_DIR}/${podfile}.in)
182+ set(POD_OUT ${CMAKE_CURRENT_BINARY_DIR}/${podfile})
183+ configure_file(${POD_IN} ${POD_OUT})
184+ pod2man(${POD_OUT} ${INKSCAPE_VERSION} 1 "Inkscape Commands Manual")
185+ endforeach()
186+endif()
187
188 # -----------------------------------------------------------------------------
189 # Installation
190@@ -191,10 +221,185 @@
191
192 # this should probably be done no matter what the platform is, just set SHARE_INSTALL first
193 add_subdirectory(share)
194+elseif(WIN32)
195+ SET(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/inkscape)
196+
197+ install(PROGRAMS
198+ ${EXECUTABLE_OUTPUT_PATH}/inkscape.exe
199+ ${EXECUTABLE_OUTPUT_PATH}/inkview.exe
200+ DESTINATION ${CMAKE_INSTALL_PREFIX}
201+ )
202+
203+ install(FILES
204+ ${LIBRARY_OUTPUT_PATH}/libinkscape_base.dll
205+ ${LIBRARY_OUTPUT_PATH}/libgrid2.dll
206+ DESTINATION ${CMAKE_INSTALL_PREFIX}
207+ )
208+
209+ # devlibs and mingw dlls
210+ install(FILES
211+ AUTHORS
212+ COPYING
213+ COPYING.LIB
214+ NEWS
215+ README
216+ TRANSLATORS
217+ ${DEVLIBS_BIN}/libatkmm-1.6-1.dll
218+ ${DEVLIBS_BIN}/libglibmm-2.4-1.dll
219+ ${DEVLIBS_BIN}/libgiomm-2.4-1.dll
220+ ${DEVLIBS_BIN}/libgtkmm-2.4-1.dll
221+ ${DEVLIBS_BIN}/libgdkmm-2.4-1.dll
222+ ${DEVLIBS_BIN}/libpangomm-1.4-1.dll
223+ ${DEVLIBS_BIN}/libcairomm-1.0-1.dll
224+ ${DEVLIBS_BIN}/libsigc-2.0-0.dll
225+ ${DEVLIBS_BIN}/libfreetype-6.dll
226+ ${DEVLIBS_BIN}/libffi-6.dll
227+ ${DEVLIBS_BIN}/libgc-1.dll
228+ ${DEVLIBS_BIN}/libgsl-19.dll
229+ ${DEVLIBS_BIN}/libgslcblas-0.dll
230+ ${DEVLIBS_BIN}/libharfbuzz-0.dll
231+ ${DEVLIBS_BIN}/liblzma-5.dll
232+ ${DEVLIBS_BIN}/libaspell-15.dll
233+ ${DEVLIBS_BIN}/libatk-1.0-0.dll
234+ ${DEVLIBS_BIN}/libgdk-win32-2.0-0.dll
235+ ${DEVLIBS_BIN}/libgdk_pixbuf-2.0-0.dll
236+ ${DEVLIBS_BIN}/libglib-2.0-0.dll
237+ ${DEVLIBS_BIN}/libgmodule-2.0-0.dll
238+ ${DEVLIBS_BIN}/libgobject-2.0-0.dll
239+ ${DEVLIBS_BIN}/libgtk-win32-2.0-0.dll
240+ ${DEVLIBS_BIN}/libgthread-2.0-0.dll
241+ ${DEVLIBS_BIN}/libgio-2.0-0.dll
242+ ${DEVLIBS_BIN}/libcairo-2.dll
243+ ${DEVLIBS_BIN}/libpixman-1-0.dll
244+ ${DEVLIBS_BIN}/libpoppler-58.dll
245+ ${DEVLIBS_BIN}/libpoppler-glib-8.dll
246+ ${DEVLIBS_BIN}/libpangocairo-1.0-0.dll
247+ ${DEVLIBS_BIN}/libpango-1.0-0.dll
248+ ${DEVLIBS_BIN}/libpangoft2-1.0-0.dll
249+ ${DEVLIBS_BIN}/libpangowin32-1.0-0.dll
250+ ${DEVLIBS_BIN}/libfontconfig-1.dll
251+ ${DEVLIBS_BIN}/libxml2-2.dll
252+ ${DEVLIBS_BIN}/libxslt-1.dll
253+ ${DEVLIBS_BIN}/libexslt-0.dll
254+ ${DEVLIBS_BIN}/libexpat-1.dll
255+ ${DEVLIBS_BIN}/librevenge-0.0.dll
256+ ${DEVLIBS_BIN}/librevenge-stream-0.0.dll
257+ ${DEVLIBS_BIN}/libwpg-0.3.dll
258+ ${DEVLIBS_BIN}/libwpd-0.10.dll
259+ ${DEVLIBS_BIN}/libvisio-0.1.dll
260+ ${DEVLIBS_BIN}/libcdr-0.1.dll
261+ ${DEVLIBS_BIN}/icuin56.dll
262+ ${DEVLIBS_BIN}/icudt56.dll
263+ ${DEVLIBS_BIN}/icuuc56.dll
264+ ${DEVLIBS_BIN}/libjpeg-9.dll
265+ ${DEVLIBS_BIN}/libpng16-16.dll
266+ ${DEVLIBS_BIN}/libtiff-5.dll
267+ ${DEVLIBS_BIN}/libexif-12.dll
268+ ${DEVLIBS_BIN}/libcurl-4.dll
269+ ${DEVLIBS_BIN}/zlib1.dll
270+ ${DEVLIBS_BIN}/bz2-1.dll
271+ ${DEVLIBS_BIN}/libiconv-2.dll
272+ ${DEVLIBS_BIN}/libpopt-0.dll
273+ ${DEVLIBS_BIN}/liblcms2-2.dll
274+ ${DEVLIBS_BIN}/libMagick++-6.Q16-6.dll
275+ ${DEVLIBS_BIN}/libMagickCore-6.Q16-2.dll
276+ ${DEVLIBS_BIN}/libMagickWand-6.Q16-2.dll
277+ ${DEVLIBS_BIN}/libintl-8.dll
278+ ${DEVLIBS_BIN}/libpotrace-0.dll
279+ ${MINGW_BIN}/libstdc++-6.dll
280+ ${MINGW_BIN}/libwinpthread-1.dll
281+ ${MINGW_BIN}/libgcc_s_seh-1.dll
282+ ${MINGW_BIN}/libgomp-1.dll
283+ DESTINATION ${CMAKE_INSTALL_PREFIX})
284+
285+ # Setup application data directories, poppler files, locales, icons and themes
286+ file(MAKE_DIRECTORY
287+ data
288+ doc
289+ modules
290+ plugins)
291+
292+ install(DIRECTORY
293+ data
294+ doc
295+ modules
296+ plugins
297+ share
298+ DESTINATION ${CMAKE_INSTALL_PREFIX}
299+ PATTERN Adwaita EXCLUDE # NOTE: The theme is not used on Windows.
300+ PATTERN hicolor/index.theme EXCLUDE # NOTE: Empty index.theme in hicolor icon theme causes SIGSEGV.
301+ PATTERN CMakeLists.txt EXCLUDE
302+ PATTERN *.am EXCLUDE)
303+
304+ install(DIRECTORY ${DEVLIBS_PATH}/share/themes
305+ DESTINATION ${CMAKE_INSTALL_PREFIX}/share)
306+
307+ install(DIRECTORY ${DEVLIBS_PATH}/share/poppler
308+ DESTINATION ${CMAKE_INSTALL_PREFIX}/share)
309+
310+ install(DIRECTORY ${DEVLIBS_PATH}/etc/fonts
311+ DESTINATION ${CMAKE_INSTALL_PREFIX}/etc)
312
313+ install(DIRECTORY ${DEVLIBS_PATH}/share/locale
314+ DESTINATION ${CMAKE_INSTALL_PREFIX})
315+
316+ install(DIRECTORY ${DEVLIBS_PATH}/etc/gtk-2.0
317+ DESTINATION ${CMAKE_INSTALL_PREFIX}/etc)
318+
319+ # GTK 2.0
320+ install(DIRECTORY ${DEVLIBS_LIB}/gtk-2.0
321+ DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
322+ FILES_MATCHING
323+ PATTERN "*.dll"
324+ PATTERN "*.cache")
325+
326+ install(DIRECTORY ${DEVLIBS_LIB}/gdk-pixbuf-2.0
327+ DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
328+ FILES_MATCHING
329+ PATTERN "*.dll"
330+ PATTERN "*.cache")
331+
332+ # Aspell dictionaries
333+ install(DIRECTORY ${DEVLIBS_LIB}/aspell-0.60
334+ DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
335+
336+ # Necessary to run extensions on windows if it is not in the path
337+ if (CMAKE_SYSTEM_PROCESSOR MATCHES "AMD64")
338+ install(FILES
339+ ${DEVLIBS_BIN}/gspawn-win64-helper.exe
340+ ${DEVLIBS_BIN}/gspawn-win64-helper-console.exe
341+ DESTINATION ${CMAKE_INSTALL_PREFIX})
342+ else()
343+ install(FILES
344+ ${DEVLIBS_BIN}/gspawn-win32-helper.exe
345+ ${DEVLIBS_BIN}/gspawn-win32-helper-console.exe
346+ DESTINATION ${CMAKE_INSTALL_PREFIX})
347+ endif()
348+
349+ # Perl
350+ install(FILES
351+ ${DEVLIBS_PATH}/perl/bin/perl58.dll
352+ DESTINATION ${CMAKE_INSTALL_PREFIX})
353+
354+ # Python
355+ install(FILES
356+ ${DEVLIBS_PATH}/python/python.exe
357+ ${DEVLIBS_PATH}/python/pythonw.exe
358+ ${DEVLIBS_PATH}/python/python27.dll
359+ DESTINATION ${CMAKE_INSTALL_PREFIX}/python)
360+
361+ install(DIRECTORY ${DEVLIBS_PATH}/python/lib
362+ DESTINATION ${CMAKE_INSTALL_PREFIX}/python)
363+
364+ install(DIRECTORY ${DEVLIBS_PATH}/python/dlls
365+ DESTINATION ${CMAKE_INSTALL_PREFIX}/python)
366 else()
367+<<<<<<< TREE
368 # TODO, WIN32, APPLE/OSX, MinGW
369
370+=======
371+ # TODO: Mac OS X
372+>>>>>>> MERGE-SOURCE
373 endif()
374
375 # -----------------------------------------------------------------------------
376@@ -245,6 +450,13 @@
377 message("CMAKE_C_COMPILER: ${CMAKE_C_COMPILER}")
378 message("CMAKE_CXX_COMPILER: ${CMAKE_CXX_COMPILER}")
379 message("CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
380+
381+if(WIN32)
382+message("CMAKE_PREFIX_PATH: ${CMAKE_PREFIX_PATH}")
383+message("CMAKE_FIND_LIBRARY_PREFIXES: ${CMAKE_FIND_LIBRARY_PREFIXES}")
384+message("CMAKE_FIND_LIBRARY_SUFFIXES: ${CMAKE_FIND_LIBRARY_SUFFIXES}")
385+endif()
386+
387 message("")
388
389 # dependency info
390@@ -263,4 +475,23 @@
391 message("WITH_NLS: ${WITH_NLS}")
392 message("WITH_OPENMP: ${WITH_OPENMP}")
393 message("WITH_PROFILING: ${WITH_PROFILING}")
394+
395+message("")
396+
397+if(WIN32)
398+message("HAVE_MINGW: ${HAVE_MINGW}")
399+message("HAVE_MINGW64: ${HAVE_MINGW64}")
400+message("MINGW_PATH: ${MINGW_PATH}")
401+message("MINGW_ARCH: ${MINGW_ARCH}")
402+message("MINGW_ARCH_PATH: ${MINGW_ARCH_PATH}")
403+message("MINGW64_INCLUDE: ${MINGW64_INCLUDE}")
404+message("MINGW64_LIB: ${MINGW64_LIB}")
405+message("DEVLIBS_PATH: ${DEVLIBS_PATH}")
406+message("DEVLIBS_LIB: ${DEVLIBS_LIB}")
407+message("DEVLIBS_BIN: ${DEVLIBS_BIN}")
408+message("PKG_CONFIG_PATH: ${PKG_CONFIG_PATH}")
409+message("GS_PATH ${GS_PATH}")
410+message("GS_BIN ${GS_BIN}")
411+endif()
412+
413 message("------------------------------------------------------------------------")
414
415=== modified file 'CMakeScripts/ConfigPaths.cmake'
416--- CMakeScripts/ConfigPaths.cmake 2016-01-17 07:05:58 +0000
417+++ CMakeScripts/ConfigPaths.cmake 2016-06-28 06:54:18 +0000
418@@ -1,9 +1,153 @@
419 message(STATUS "Creating build files in: ${CMAKE_CURRENT_BINARY_DIR}")
420
421 if(WIN32)
422+ # Directory containing the precompiled Inkscape libraries. Usually c:\devlibs or c:\devlibs64
423+ set(DEVLIBS_PATH C:/devlibs64)
424+
425+ # Directory containing the MinGW instance used for compilation. Usually c:\mingw or c:\mingw64
426+ set(MINGW_PATH C:/mingw64)
427+
428+ # Directory containing the Ghostscript installation.
429+ set(GS_PATH C:/latex/gs/gs8.61)
430+
431+ # Normalize directory separator slashes.
432+ string(REGEX REPLACE "\\\\" "/" DEVLIBS_PATH ${DEVLIBS_PATH})
433+ string(REGEX REPLACE "\\\\" "/" MINGW_PATH ${MINGW_PATH})
434+ string(REGEX REPLACE "\\\\" "/" GS_PATH ${GS_PATH})
435+
436+ # =============== DEVLIBS CHECKS ===============
437+
438+ # Directory containing the compile time .dll.a and .a files.
439+ set(DEVLIBS_LIB "${DEVLIBS_PATH}/lib")
440+
441+ if(NOT EXISTS "${DEVLIBS_LIB}")
442+ message(FATAL_ERROR "Inkscape development libraries directory does not exist: ${DEVLIBS_LIB}")
443+ endif()
444+
445+ # Add devlibs libraries to linker path.
446+ link_directories(${DEVLIBS_LIB})
447+
448+ set(DEVLIBS_INCLUDE ${DEVLIBS_PATH}/include)
449+
450+ if(NOT EXISTS ${DEVLIBS_INCLUDE})
451+ message(FATAL_ERROR "Inkscape development libraries directory does not exist: ${DEVLIBS_INCLUDE}")
452+ endif()
453+
454+ # Add general MinGW headers to compiler include path.
455+ #include_directories(${DEVLIBS_INCLUDE})
456+
457+ # Directory containing the precompiled .dll files.
458+ set(DEVLIBS_BIN ${DEVLIBS_PATH}/bin)
459+
460+ if(NOT EXISTS ${DEVLIBS_BIN})
461+ message(FATAL_ERROR "Inkscape development binaries directory does not exist: ${DEVLIBS_BIN}")
462+ endif()
463+
464+ # Directory containing the pkgconfig .pc files.
465+ set(PKG_CONFIG_PATH "${DEVLIBS_PATH}/lib/pkgconfig")
466+
467+ if(NOT EXISTS "${PKG_CONFIG_PATH}")
468+ message(FATAL_ERROR "pkgconfig directory does not exist: ${PKG_CONFIG_PATH}")
469+ endif()
470+
471+ # Add the devlibs directories to the paths used to find libraries and programs.
472+ list(APPEND CMAKE_PREFIX_PATH ${DEVLIBS_PATH})
473+
474+ # =============== MINGW CHECKS ===============
475+
476+ # We are in a MinGW environment.
477+ set(HAVE_MINGW ON)
478+
479+ # Try to determine the MinGW processor architecture.
480+ if(EXISTS ${MINGW_PATH}/mingw32)
481+ set(HAVE_MINGW64 OFF)
482+ set(MINGW_ARCH mingw32)
483+ elseif(EXISTS ${MINGW_PATH}/x86_64-w64-mingw32)
484+ set(HAVE_MINGW64 ON)
485+ set(MINGW_ARCH x86_64-w64-mingw32)
486+ else()
487+ message(FATAL_ERROR "Unable to determine MinGW processor architecture. Are you using an unsupported MinGW version?")
488+ endif()
489+
490+ # Path to processor architecture specific binaries and libs.
491+ set(MINGW_ARCH_PATH ${MINGW_PATH}/${MINGW_ARCH})
492+
493+ set(MINGW_BIN ${MINGW_PATH}/bin)
494+
495+ if(NOT EXISTS ${MINGW_BIN})
496+ message(FATAL_ERROR "MinGW binary directory does not exist: ${MINGW_BIN}")
497+ endif()
498+
499+ set(MINGW_LIB ${MINGW_PATH}/lib)
500+
501+ if(NOT EXISTS ${MINGW_LIB})
502+ message(FATAL_ERROR "MinGW library directory does not exist: ${MINGW_LIB}")
503+ endif()
504+
505+ # Add MinGW libraries to linker path.
506+ link_directories(${MINGW_LIB})
507+
508+ set(MINGW_INCLUDE ${MINGW_PATH}/include)
509+
510+ if(NOT EXISTS ${MINGW_INCLUDE})
511+ message(FATAL_ERROR "MinGW include directory does not exist: ${MINGW_INCLUDE}")
512+ endif()
513+
514+ # Add general MinGW headers to compiler include path.
515+ include_directories(${MINGW_INCLUDE})
516+
517+ if(HAVE_MINGW64)
518+ set(MINGW64_LIB ${MINGW_ARCH_PATH}/lib)
519+
520+ if(NOT EXISTS ${MINGW64_LIB})
521+ message(FATAL_ERROR "MinGW 64-Bit libraries directory does not exist: ${MINGW64_LIB}")
522+ endif()
523+
524+ # Add 64-Bit libraries to linker path.
525+ link_directories(${MINGW64_LIB})
526+
527+ set(MINGW64_INCLUDE ${MINGW_ARCH_PATH}/include)
528+
529+ if(NOT EXISTS ${MINGW64_INCLUDE})
530+ message(FATAL_ERROR "MinGW 64-Bit include directory does not exist: ${MINGW64_INCLUDE}")
531+ endif()
532+
533+ set(MINGW64_INCLUDE_SDL ${MINGW64_INCLUDE}/c++)
534+
535+ if(NOT EXISTS ${MINGW64_INCLUDE_SDL})
536+ message(FATAL_ERROR "MinGW 64-Bit SDL include directory does not exist: ${MINGW64_INCLUDE_SDL}")
537+ endif()
538+
539+ # Add 64-Bit MinGW headers to compiler include path.
540+ include_directories(${MINGW64_INCLUDE})
541+ #include_directories(${MINGW64_INCLUDE_SDL})
542+ endif()
543+
544+ # =============== GHOSTSCRIPT CHECKS ===============
545+
546+ # Check for Ghostscript.
547+ set(GS_BIN "${GS_PATH}/bin")
548+
549+ if(EXISTS "${GS_BIN}")
550+ set(HAVE_GS_BIN ON)
551+ else()
552+ set(HAVE_GS_BIN OFF)
553+ endif()
554+
555+ # =============== LIBRARY AND LINKER ===============
556+
557+ # Tweak CMake into using Unix-style library names.
558+ set(CMAKE_FIND_LIBRARY_PREFIXES "lib")
559+ set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll.a" ".dll")
560+
561+ if(NOT HAVE_MINGW64)
562+ list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES ".a")
563+ endif()
564+
565+ # Directory containing the current locale (translations).
566 set(PACKAGE_LOCALE_DIR "locale")
567 set(SHARE_INSTALL "share" CACHE STRING "Data file install path. Must be a relative path (from CMAKE_INSTALL_PREFIX), with no trailing slash.")
568-else(WIN32)
569+elseif(UNIX)
570 # TODO: check and change this to correct value:
571 if(NOT PACKAGE_LOCALE_DIR)
572 set(PACKAGE_LOCALE_DIR "${CMAKE_INSTALL_PREFIX}/share/locale") # packagers might overwrite this
573@@ -13,4 +157,4 @@
574 set(SHARE_INSTALL "share" CACHE STRING "Data file install path. Must be a relative path (from CMAKE_INSTALL_PREFIX), with no trailing slash.")
575 endif(NOT SHARE_INSTALL)
576 mark_as_advanced(SHARE_INSTALL)
577-endif(WIN32)
578+endif()
579
580=== modified file 'CMakeScripts/DefineDependsandFlags.cmake'
581--- CMakeScripts/DefineDependsandFlags.cmake 2016-06-09 09:03:26 +0000
582+++ CMakeScripts/DefineDependsandFlags.cmake 2016-06-28 06:54:18 +0000
583@@ -15,72 +15,27 @@
584 # Files we include
585 # ----------------------------------------------------------------------------
586 if(WIN32)
587-message("---------------- BEGIN: Win32 ----------------")
588-
589- # The name of the target operating system
590- set(CMAKE_SYSTEM_NAME Windows)
591-
592- message("CMAKE_SYSTEM_NAME: " ${CMAKE_SYSTEM_NAME})
593-
594- set(CMAKE_C_COMPILER gcc)
595- set(CMAKE_CXX_COMPILER g++)
596- set(CMAKE_RC_COMPILER windres)
597-
598- # Adjust the command line parameters for windres to the verion of MinGW.
599- set(CMAKE_RC_COMPILER_INIT windres)
600- enable_language(RC)
601- set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff -i <SOURCE> -o <OBJECT>")
602-
603- # Here is the target environment located
604- set(CMAKE_FIND_ROOT_PATH $ENV{MINGW_PATH}/)
605-
606- message("CMAKE_FIND_ROOT_PATH: " ${CMAKE_FIND_ROOT_PATH})
607-
608- # Tweak CMake into using Unix-style library names.
609- set(CMAKE_FIND_LIBRARY_PREFIXES "lib")
610- set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll.a" ".dll")
611-
612- message("CMAKE_FIND_LIBRARY_PREFIXES: " ${CMAKE_FIND_LIBRARY_PREFIXES})
613- message("CMAKE_FIND_LIBRARY_SUFFIXES: " ${CMAKE_FIND_LIBRARY_SUFFIXES})
614-
615- set(SDL_INCLUDE_DIR ${CMAKE_FIND_ROOT_PATH}x86_64-w64-mingw32/include/c++)
616-
617- message("SDL_INCLUDE_DIR: " ${SDL_INCLUDE_DIR})
618-
619- #if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "^amd64")
620- link_directories($ENV{MINGW_PATH}/lib)
621- link_directories($ENV{DEVLIBS_PATH}/lib)
622- link_directories($ENV{MINGW_PATH}/x86_64-w64-mingw32/lib)
623- link_directories($ENV{WINDIR}/system32)
624-
625- include_directories($ENV{MINGW_PATH}/include)
626-
627- include_directories($ENV{MINGW_PATH}/x86_64-w64-mingw32/include)
628- include_directories($ENV{MINGW_PATH}/x86_64-w64-mingw32/include/c++)
629- #endif ()
630-
631- get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
632-
633- foreach(dir ${dirs})
634- message("CMAKE_INCLUDE_DIR:" ${dir})
635- endforeach()
636-
637- add_definitions(-DFLT_EPSILON=1e-9)
638- add_definitions(-DFLT_MAX=1e+37)
639- add_definitions(-DFLT_MIN=1e-37)
640-
641- list(APPEND INKSCAPE_LIBS "-lgomp")
642- list(APPEND INKSCAPE_LIBS "-lwinpthread")
643- list(APPEND INKSCAPE_LIBS "-lmscms")
644-
645- list(APPEND INKSCAPE_CXX_FLAGS "-mwindows")
646- list(APPEND INKSCAPE_CXX_FLAGS "-mthreads")
647- list(APPEND INKSCAPE_CXX_FLAGS "-m64")
648-
649- # Try to compile using C++ 11.
650- set(CMAKE_CXX_STANDARD 11)
651-
652- message("---------------- END: Win32 ----------------")
653+ # Set the link and include directories
654+ get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
655+
656+ # MinGW supplied STL does not define these floating point constants.. :/
657+ add_definitions(-DFLT_EPSILON=1e-9)
658+ add_definitions(-DFLT_MAX=1e+37)
659+ add_definitions(-DFLT_MIN=1e-37)
660+
661+ list(APPEND INKSCAPE_LIBS "-lmscms")
662+
663+ list(APPEND INKSCAPE_CXX_FLAGS "-mwindows")
664+ list(APPEND INKSCAPE_CXX_FLAGS "-mthreads")
665+
666+ if(HAVE_MINGW64)
667+ list(APPEND INKSCAPE_LIBS "-lgomp")
668+ list(APPEND INKSCAPE_LIBS "-lwinpthread")
669+
670+ list(APPEND INKSCAPE_CXX_FLAGS "-m64")
671+ else()
672+ list(APPEND INKSCAPE_CXX_FLAGS "-m32")
673+ endif()
674 endif()
675
676 pkg_check_modules(INKSCAPE_DEP REQUIRED pangocairo pangoft2 fontconfig gthread-2.0 gsl gmodule-2.0)
677
678=== added directory 'build'
679=== added file 'build/configure.bat'
680--- build/configure.bat 1970-01-01 00:00:00 +0000
681+++ build/configure.bat 2016-06-28 06:54:18 +0000
682@@ -0,0 +1,9 @@
683+REM Delete the CMake cache. Needed when changes on the CMakeLists should be applied in a consistent way.
684+del CMakeCache.txt
685+rmdir /s /q CMakeFiles
686+
687+REM Reset the console colors just in case CMake screwed them up again.
688+Color 07
689+
690+REM Configure using the MinGW compiler chain.
691+cmake .. -G "MinGW Makefiles"
692\ No newline at end of file
693
694=== added file 'build/touch.bat'
695--- build/touch.bat 1970-01-01 00:00:00 +0000
696+++ build/touch.bat 2016-06-28 06:54:18 +0000
697@@ -0,0 +1,4 @@
698+REM NOTE: Use this command to significantly speed up compilation when changing the CMake config.
699+
700+REM Updating the modification date of object files so they do not need to be recompiled..
701+forfiles /s /m *.obj /c "cmd /c copy /b @path +,,"
702\ No newline at end of file
703
704=== modified file 'config.h.cmake'
705--- config.h.cmake 2016-06-05 07:13:26 +0000
706+++ config.h.cmake 2016-06-28 06:54:18 +0000
707@@ -232,10 +232,18 @@
708 #cmakedefine HAVE_ZLIB_H 1
709
710 /* Base data directory -- only path-prefix.h should use it! */
711+#ifdef WIN32
712+#define INKSCAPE_DATADIR ""
713+#else
714 #define INKSCAPE_DATADIR "${CMAKE_INSTALL_PREFIX}/share"
715+#endif
716
717 /* Base library directory -- only path-prefix.h should use it! */
718+#ifdef WIN32
719+#define INKSCAPE_LIBDIR "\\lib"
720+#else
721 #define INKSCAPE_LIBDIR "${CMAKE_INSTALL_PREFIX}/lib"
722+#endif
723
724 /* Define to 1 if `lstat' dereferences a symlink specified with a trailing
725 slash. */
726
727=== renamed file 'configure.bat' => 'configure.bat.THIS'
728=== modified file 'mingwenv.bat'
729--- mingwenv.bat 2014-07-28 20:11:22 +0000
730+++ mingwenv.bat 2016-06-28 06:54:18 +0000
731@@ -1,6 +1,6 @@
732 @echo Setting environment variables for MinGw build of Inkscape
733-IF "%DEVLIBS_PATH%"=="" set DEVLIBS_PATH=c:\devlibs
734-IF "%MINGW_PATH%"=="" set MINGW_PATH=c:\mingw
735+IF "%DEVLIBS_PATH%"=="" set DEVLIBS_PATH=c:\devlibs64
736+IF "%MINGW_PATH%"=="" set MINGW_PATH=c:\mingw64
737 set MINGW_BIN=%MINGW_PATH%\bin
738 set PKG_CONFIG_PATH=%DEVLIBS_PATH%\lib\pkgconfig
739 set GS_BIN=C:\latex\gs\gs8.61\bin
740
741=== modified file 'src/CMakeLists.txt'
742--- src/CMakeLists.txt 2016-06-12 08:25:42 +0000
743+++ src/CMakeLists.txt 2016-06-28 06:54:18 +0000
744@@ -2,10 +2,6 @@
745 # Define the main source
746 # -----------------------------------------------------------------------------
747
748-set(main_SRC
749- main.cpp
750-)
751-
752 set(sp_SRC
753 attribute-rel-css.cpp
754 attribute-rel-svg.cpp
755@@ -423,21 +419,6 @@
756 version.h
757 )
758
759-if(WIN32)
760- list(APPEND inkscape_SRC
761- inkscape.rc
762- registrytool.cpp
763- #deptool.cpp
764- winconsole.cpp
765- winmain.cpp
766-
767- # -------
768- # Headers
769- registrytool.h
770- )
771-endif()
772-
773-
774 # -----------------------------------------------------------------------------
775 # Generate version file
776 # -----------------------------------------------------------------------------
777@@ -505,8 +486,26 @@
778 # -----------------------------------------------------------------------------
779 # Setup the executable
780 # -----------------------------------------------------------------------------
781-#add_inkscape_lib(sp_LIB "${sp_SRC}")
782-#add_inkscape_lib(inkscape_LIB "${inkscape_SRC}")
783+
784+if(WIN32)
785+ # Sources for the inkscape executable on Windows.
786+ set(main_SRC
787+ registrytool.h
788+ registrytool.cpp
789+ main.cpp
790+ winmain.cpp
791+ #winconsole.cpp
792+ )
793+
794+ # Add the platform specific resource files (enabling the app icon).
795+ if(${HAVE_MINGW64})
796+ list(APPEND main_SRC inkscape-x64.rc)
797+ else()
798+ list(APPEND main_SRC inkscape.rc)
799+ endif()
800+else()
801+ set(main_SRC main.cpp)
802+endif()
803
804 # Build everything except main and inkview.c in a shared library.
805 add_library(inkscape_base SHARED ${inkscape_SRC} ${sp_SRC})
806@@ -515,6 +514,18 @@
807 add_executable(inkscape ${main_SRC} )
808 add_executable(inkview inkview.cpp )
809
810+<<<<<<< TREE
811+=======
812+if(UNIX)
813+# message after building.
814+add_custom_command(
815+ TARGET inkscape
816+ POST_BUILD MAIN_DEPENDENCY inkscape
817+ COMMAND ${CMAKE_COMMAND} -E echo 'now run: \"make install\" to copy runtime files & scripts to ${CMAKE_INSTALL_PREFIX}'
818+)
819+endif()
820+
821+>>>>>>> MERGE-SOURCE
822 add_dependencies(inkscape inkscape_version)
823
824 if(WITH_DBUS)
825@@ -525,11 +536,9 @@
826 # order from automake
827 #sp_LIB
828 #nrtype_LIB
829-
830 #inkscape_LIB
831 #sp_LIB # annoying, we need both!
832 nrtype_LIB # annoying, we need both!
833-
834 croco_LIB
835 avoid_LIB
836 cola_LIB
837@@ -548,15 +557,19 @@
838 list (INSERT INKSCAPE_TARGET_LIBS 0 "gdl_LIB")
839 endif()
840
841-
842-
843-
844+<<<<<<< TREE
845+
846+
847+
848+=======
849+>>>>>>> MERGE-SOURCE
850 # Link the inkscape_base library against all external dependencies
851 target_link_libraries(inkscape_base ${INKSCAPE_TARGET_LIBS})
852
853 # Link inkscape and inkview against inkscape_base
854 target_link_libraries(inkscape inkscape_base )
855 target_link_libraries(inkview inkscape_base)
856+<<<<<<< TREE
857
858 #Define the installation
859 install(
860@@ -567,3 +580,5 @@
861 )
862
863
864+=======
865+>>>>>>> MERGE-SOURCE
866
867=== removed file 'touch.bat'
868--- touch.bat 2016-04-16 15:59:22 +0000
869+++ touch.bat 1970-01-01 00:00:00 +0000
870@@ -1,1 +0,0 @@
871-forfiles /s /m *.obj /c "cmd /c copy /b @path +,,"
872\ No newline at end of file