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/DefineDependsandFlags.cmake | |
| 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/DefineDependsandFlags.cmake')
| -rw-r--r-- | CMakeScripts/DefineDependsandFlags.cmake | 69 |
1 files changed, 68 insertions, 1 deletions
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) |
