diff options
| author | Moritz Eberl <moritz@semiodesk.com> | 2016-04-16 17:24:08 +0000 |
|---|---|---|
| committer | Moritz Eberl <moritz@semiodesk.com> | 2016-04-16 17:24:08 +0000 |
| commit | 69cb9b68955f341000342bcf3b90cfd4c41a1fd8 (patch) | |
| tree | b6061c25987d6300bd03189c03259d66bab7c0b6 /CMakeScripts | |
| parent | Added Sebastian Faubels helper scripts for windows. (diff) | |
| parent | CMake build: builds with WITH_DBUS (diff) | |
| download | inkscape-69cb9b68955f341000342bcf3b90cfd4c41a1fd8.tar.gz inkscape-69cb9b68955f341000342bcf3b90cfd4c41a1fd8.zip | |
merge and fixed build
(bzr r14761.1.11)
Diffstat (limited to 'CMakeScripts')
| -rw-r--r-- | CMakeScripts/ConfigChecks.cmake | 3 | ||||
| -rw-r--r-- | CMakeScripts/DefineDependsandFlags.cmake | 64 | ||||
| -rw-r--r-- | CMakeScripts/Modules/FindSigC++.cmake | 6 |
3 files changed, 35 insertions, 38 deletions
diff --git a/CMakeScripts/ConfigChecks.cmake b/CMakeScripts/ConfigChecks.cmake index d12a37cbe..a247f4e72 100644 --- a/CMakeScripts/ConfigChecks.cmake +++ b/CMakeScripts/ConfigChecks.cmake @@ -66,7 +66,6 @@ if(HAVE_CAIRO_PDF) set(RENDER_WITH_PANGO_CAIRO TRUE) endif() -# Create the two configuration files: config.h and inkscape_version.h -# Create them in the binary root dir +# Create the configuration files config.h in the binary root dir configure_file(${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_BINARY_DIR}/include/config.h) add_definitions(-DHAVE_CONFIG_H) diff --git a/CMakeScripts/DefineDependsandFlags.cmake b/CMakeScripts/DefineDependsandFlags.cmake index 4f02d258b..f2a6b5670 100644 --- a/CMakeScripts/DefineDependsandFlags.cmake +++ b/CMakeScripts/DefineDependsandFlags.cmake @@ -14,9 +14,8 @@ list(APPEND INKSCAPE_INCS ${PROJECT_SOURCE_DIR} # ---------------------------------------------------------------------------- # Files we include # ---------------------------------------------------------------------------- - if(WIN32) - message("---------------- BEGIN: Win32 ----------------") +message("---------------- BEGIN: Win32 ----------------") # The name of the target operating system set(CMAKE_SYSTEM_NAME Windows) @@ -33,13 +32,12 @@ if(WIN32) set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff -i <SOURCE> -o <OBJECT>") # Here is the target environment located - set(CMAKE_FIND_ROOT_PATH $ENV{MINGW_PATH}/mingw64/) + set(CMAKE_FIND_ROOT_PATH $ENV{MINGW_PATH}/) message("CMAKE_FIND_ROOT_PATH: " ${CMAKE_FIND_ROOT_PATH}) # Tweak CMake into using Unix-style library names. set(CMAKE_FIND_LIBRARY_PREFIXES "lib") - #set(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a" ".dll.a") set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll.a" ".dll") message("CMAKE_FIND_LIBRARY_PREFIXES: " ${CMAKE_FIND_LIBRARY_PREFIXES}) @@ -50,14 +48,15 @@ if(WIN32) message("SDL_INCLUDE_DIR: " ${SDL_INCLUDE_DIR}) #if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "^amd64") + link_directories($ENV{MINGW_PATH}/lib) link_directories($ENV{DEVLIBS_PATH}/lib) - link_directories($ENV{MINGW_PATH}/mingw64/lib) - link_directories($ENV{MINGW_PATH}/mingw64/x86_64-w64-mingw32/lib) + link_directories($ENV{MINGW_PATH}/x86_64-w64-mingw32/lib) link_directories($ENV{WINDIR}/system32) - - include_directories($ENV{MINGW_PATH}/mingw64/include) - include_directories($ENV{MINGW_PATH}/mingw64/x86_64-w64-mingw32/include) - include_directories($ENV{MINGW_PATH}/mingw64/x86_64-w64-mingw32/include/c++) + + include_directories($ENV{MINGW_PATH}/include) + + include_directories($ENV{MINGW_PATH}/x86_64-w64-mingw32/include) + include_directories($ENV{MINGW_PATH}/x86_64-w64-mingw32/include/c++) #endif () get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES) @@ -81,9 +80,7 @@ if(WIN32) # Try to compile using C++ 11. set(CMAKE_CXX_STANDARD 11) - message("CMAKE_CXX_STANDARD: " ${CMAKE_CXX_STANDARD}) message("---------------- END: Win32 ----------------") - endif() pkg_check_modules(INKSCAPE_DEP REQUIRED pangocairo pangoft2 fontconfig gthread-2.0 gsl gmodule-2.0) @@ -253,11 +250,13 @@ else(POTRACE_FOUND) endif() if(WITH_DBUS) - find_package(DBus REQUIRED) + pkg_check_modules(DBUS dbus-1 dbus-glib-1) if(DBUS_FOUND) - list(APPEND INKSCAPE_INCS_SYS ${DBUS_INCLUDE_DIR}) - list(APPEND INKSCAPE_INCS_SYS ${DBUS_ARCH_INCLUDE_DIR}) - list(APPEND INKSCAPE_LIBS ${DBUS_LIBRARIES}) + list(APPEND INKSCAPE_LIBS ${DBUS_LDFLAGS}) + list(APPEND INKSCAPE_INCS_SYS ${DBUS_INCLUDE_DIRS} ${CMAKE_BINARY_DIR}/src/extension/dbus/) + list(APPEND INKSCAPE_LIBS ${DBUS_LIBRARIES}) + add_definitions(${DBUS_CFLAGS_OTHER}) + else() set(WITH_DBUS OFF) endif() @@ -309,7 +308,7 @@ if("${WITH_GTK3_EXPERIMENTAL}") pkg_check_modules(GDL_3_6 gdl-3.0>=3.6) if("${GDL_3_6_FOUND}") - message("Using Gdl 3.6 or higher") + message("Using GDL 3.6 or higher") set (WITH_GDL_3_6 1) endif() @@ -317,9 +316,12 @@ if("${WITH_GTK3_EXPERIMENTAL}") pkg_check_modules(GTKSPELL3 gtkspell3-3.0) if("${GTKSPELL3_FOUND}") - message("Using GtkSpell3 3.0") + message("Using GtkSpell 3") set (WITH_GTKSPELL 1) + else() + unset(WITH_GTKSPELL) endif() + list(APPEND INKSCAPE_INCS_SYS ${GTK3_INCLUDE_DIRS} ${GTKSPELL3_INCLUDE_DIRS} @@ -338,19 +340,21 @@ else() ) list(APPEND INKSCAPE_CXX_FLAGS ${GTK_CFLAGS_OTHER}) pkg_check_modules(GTKSPELL2 gtkspell-2.0) - if("${GTKSPELL3_FOUND}") - message("Using GtkSpell3 3.0") - add_definitions(${GTK_CFLAGS_OTHER}) + if("${GTKSPELL2_FOUND}") + message("Using GtkSpell 2") + add_definitions(${GTKSPELL2_CFLAGS_OTHER}) set (WITH_GTKSPELL 1) + else() + unset(WITH_GTKSPELL) endif() list(APPEND INKSCAPE_INCS_SYS ${GTK_INCLUDE_DIRS} - ${GTKSPELL_INCLUDE_DIRS} + ${GTKSPELL2_INCLUDE_DIRS} ) list(APPEND INKSCAPE_LIBS ${GTK_LIBRARIES} - ${GTKSPELL_LIBRARIES} + ${GTKSPELL2_LIBRARIES} ) endif() @@ -370,17 +374,6 @@ if(ASPELL_FOUND) set(HAVE_ASPELL TRUE) endif() -if("${TRY_GTKSPELL}" AND "${WITH_GTKSPELL}") - find_package(GtkSpell) - if(GTKSPELL_FOUND) - list(APPEND INKSCAPE_INCS_SYS ${GTKSPELL_INCLUDE_DIR}) - list(APPEND INKSCAPE_LIBS ${GTKSPELL_LIBRARIES}) - add_definitions(${GTKSPELL_DEFINITIONS}) - else() - set(WITH_GTKSPELL OFF) - endif() -endif() - #find_package(OpenSSL) #list(APPEND INKSCAPE_INCS_SYS ${OPENSSL_INCLUDE_DIR}) #list(APPEND INKSCAPE_LIBS ${OPENSSL_LIBRARIES}) @@ -444,6 +437,9 @@ if(WITH_NLS) endif(GETTEXT_FOUND) endif(WITH_NLS) +#sets c++11 for newer sigc++ if required when pkg-config does not detect it +find_package(SigC++ REQUIRED) + pkg_check_modules(SIGC++ REQUIRED sigc++-2.0 ) list(APPEND INKSCAPE_LIBS ${SIGC++_LDFLAGS}) diff --git a/CMakeScripts/Modules/FindSigC++.cmake b/CMakeScripts/Modules/FindSigC++.cmake index 8046410b5..14cbf47f7 100644 --- a/CMakeScripts/Modules/FindSigC++.cmake +++ b/CMakeScripts/Modules/FindSigC++.cmake @@ -106,10 +106,12 @@ endif (SIGC++_LIBRARIES AND SIGC++_INCLUDE_DIRS) # https://bugs.launchpad.net/inkscape/+bug/1488079 macro (sigcpp_compile extra_cppflags) + set(sigcpp_compile_output "") try_compile(SIGCPP_COMPILES_FINE "${CMAKE_BINARY_DIR}/sigcpp-bindir" SOURCES "${CMAKE_SOURCE_DIR}/CMakeScripts/Modules/sigcpp_test.cpp" COMPILE_DEFINITIONS ${_SIGC++_CFLAGS} ${extra_cppflags} - LINK_LIBRARIES ${SIGC++_LIBRARIES}) + LINK_LIBRARIES ${SIGC++_LIBRARIES} + OUTPUT_VARIABLE sigcpp_compile_output) endmacro() @@ -120,7 +122,7 @@ if (NOT "${SIGCPP_COMPILES_FINE}") if ("${SIGCPP_COMPILES_FINE}") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${cppflag}") else() - message(FATAL_ERROR "Could not compile against SIGC++") + message(FATAL_ERROR "Could not compile against SIGC++ - output is <<${sigcpp_compile_output}>>") endif() endif() |
