diff options
| author | Moritz Eberl <moritz@semiodesk.com> | 2016-04-16 13:11:39 +0000 |
|---|---|---|
| committer | Moritz Eberl <moritz@semiodesk.com> | 2016-04-16 13:11:39 +0000 |
| commit | f9a9eedc285caf24f095135e8df191acd820ccaf (patch) | |
| tree | 34f0c5e31f21e685a28c2720ca6d53b79ab3d0cf /CMakeScripts | |
| parent | CMake build creates a shared libinkscape_base library and links inkscape and ... (diff) | |
| download | inkscape-f9a9eedc285caf24f095135e8df191acd820ccaf.tar.gz inkscape-f9a9eedc285caf24f095135e8df191acd820ccaf.zip | |
Added Sebastian Faubels CMake changes for the windows build.
(bzr r14761.1.7)
Diffstat (limited to 'CMakeScripts')
| -rw-r--r-- | CMakeScripts/ConfigChecks.cmake | 3 | ||||
| -rw-r--r-- | CMakeScripts/DefineDependsandFlags.cmake | 69 |
2 files changed, 70 insertions, 2 deletions
diff --git a/CMakeScripts/ConfigChecks.cmake b/CMakeScripts/ConfigChecks.cmake index 926dc3ad3..d12a37cbe 100644 --- a/CMakeScripts/ConfigChecks.cmake +++ b/CMakeScripts/ConfigChecks.cmake @@ -3,6 +3,7 @@ # Set all HAVE_XXX variables, to correctly set all defines in config.h #SET(CMAKE_REQUIRED_INCLUDES ${INK_INCLUDES}) include(CheckIncludeFiles) +include(CheckIncludeFileCXX) include(CheckFunctionExists) include(CheckStructHasMember) # usage: CHECK_INCLUDE_FILES (<header> <RESULT_VARIABLE> ) @@ -12,7 +13,7 @@ include(CheckStructHasMember) set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${INKSCAPE_LIBS}) set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${INKSCAPE_INCS_SYS}) -CHECK_INCLUDE_FILES(boost/concept_check.hpp HAVE_BOOST_CONCEPT_CHECK_HPP) +CHECK_INCLUDE_FILE_CXX(boost/concept_check.hpp HAVE_BOOST_CONCEPT_CHECK_HPP) CHECK_INCLUDE_FILES(cairo-pdf.h HAVE_CAIRO_PDF) CHECK_FUNCTION_EXISTS(floor HAVE_FLOOR) CHECK_FUNCTION_EXISTS(fpsetmask HAVE_FPSETMASK) diff --git a/CMakeScripts/DefineDependsandFlags.cmake b/CMakeScripts/DefineDependsandFlags.cmake index 61500fe97..c9367d2a1 100644 --- a/CMakeScripts/DefineDependsandFlags.cmake +++ b/CMakeScripts/DefineDependsandFlags.cmake @@ -16,7 +16,74 @@ list(APPEND INKSCAPE_INCS ${PROJECT_SOURCE_DIR} # ---------------------------------------------------------------------------- if(WIN32) - link_directories($ENV{DEVLIBS_PATH}/lib) + message("---------------- BEGIN: Win32 ----------------") + + # The name of the target operating system + set(CMAKE_SYSTEM_NAME Windows) + + message("CMAKE_SYSTEM_NAME: " ${CMAKE_SYSTEM_NAME}) + + set(CMAKE_C_COMPILER gcc) + set(CMAKE_CXX_COMPILER g++) + set(CMAKE_RC_COMPILER windres) + + # Adjust the command line parameters for windres to the verion of MinGW. + set(CMAKE_RC_COMPILER_INIT windres) + enable_language(RC) + 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/) + + 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}) + message("CMAKE_FIND_LIBRARY_SUFFIXES: " ${CMAKE_FIND_LIBRARY_SUFFIXES}) + + set(SDL_INCLUDE_DIR ${CMAKE_FIND_ROOT_PATH}x86_64-w64-mingw32/include/c++) + + message("SDL_INCLUDE_DIR: " ${SDL_INCLUDE_DIR}) + + #if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "^amd64") + 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{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++) + #endif () + + get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES) + + foreach(dir ${dirs}) + message("CMAKE_INCLUDE_DIR:" ${dir}) + endforeach() + + add_definitions(-DFLT_EPSILON=1e-9) + add_definitions(-DFLT_MAX=1e+37) + add_definitions(-DFLT_MIN=1e-37) + + list(APPEND INKSCAPE_LIBS "-lgomp") + list(APPEND INKSCAPE_LIBS "-lwinpthread") + list(APPEND INKSCAPE_LIBS "-lmscms") + + list(APPEND INKSCAPE_CXX_FLAGS "-mwindows") + list(APPEND INKSCAPE_CXX_FLAGS "-mthreads") + list(APPEND INKSCAPE_CXX_FLAGS "-m64") + + # 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) |
