summaryrefslogtreecommitdiffstats
path: root/CMakeScripts/DefineDependsandFlags.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeScripts/DefineDependsandFlags.cmake')
-rw-r--r--CMakeScripts/DefineDependsandFlags.cmake88
1 files changed, 22 insertions, 66 deletions
diff --git a/CMakeScripts/DefineDependsandFlags.cmake b/CMakeScripts/DefineDependsandFlags.cmake
index 706860a00..b708484af 100644
--- a/CMakeScripts/DefineDependsandFlags.cmake
+++ b/CMakeScripts/DefineDependsandFlags.cmake
@@ -15,75 +15,31 @@ list(APPEND INKSCAPE_INCS ${PROJECT_SOURCE_DIR}
# Files we include
# ----------------------------------------------------------------------------
if(WIN32)
-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}/)
-
- 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 ".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{MINGW_PATH}/lib)
- link_directories($ENV{DEVLIBS_PATH}/lib)
- link_directories($ENV{MINGW_PATH}/x86_64-w64-mingw32/lib)
- link_directories($ENV{WINDIR}/system32)
-
- 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)
-
- 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("---------------- END: Win32 ----------------")
+ # Set the link and include directories
+ get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
+
+ # MinGW supplied STL does not define these floating point constants.. :/
+ add_definitions(-DFLT_EPSILON=1e-9)
+ add_definitions(-DFLT_MAX=1e+37)
+ add_definitions(-DFLT_MIN=1e-37)
+
+ list(APPEND INKSCAPE_LIBS "-lmscms")
+
+ list(APPEND INKSCAPE_CXX_FLAGS "-mwindows")
+ list(APPEND INKSCAPE_CXX_FLAGS "-mthreads")
+
+ if(HAVE_MINGW64)
+ list(APPEND INKSCAPE_LIBS "-lgomp")
+ list(APPEND INKSCAPE_LIBS "-lwinpthread")
+
+ list(APPEND INKSCAPE_CXX_FLAGS "-m64")
+ else()
+ list(APPEND INKSCAPE_CXX_FLAGS "-m32")
+ endif()
endif()
pkg_check_modules(INKSCAPE_DEP REQUIRED pangocairo pangoft2 fontconfig gthread-2.0 gsl gmodule-2.0)
+
list(APPEND INKSCAPE_LIBS ${INKSCAPE_DEP_LDFLAGS})
list(APPEND INKSCAPE_INCS_SYS ${INKSCAPE_DEP_INCLUDE_DIRS})
list(APPEND INKSCAPE_LIBS ${INKSCAPE_DEP_LIBRARIES})