summaryrefslogtreecommitdiffstats
path: root/CMakeScripts
diff options
context:
space:
mode:
authorMarc Jeanmougin <marc@jeanmougin.fr>2016-04-16 17:59:33 +0000
committerMarc Jeanmougin <marcjeanmougin@free.fr>2016-04-16 17:59:33 +0000
commitccdbf0118747b5046937e85258e0f1d266634c90 (patch)
tree65207b810613f23d5ea11f330f7fe02e32e55b70 /CMakeScripts
parentCXX flags dedup on CMake builds (diff)
parentremoved unnecessary comments (diff)
downloadinkscape-ccdbf0118747b5046937e85258e0f1d266634c90.tar.gz
inkscape-ccdbf0118747b5046937e85258e0f1d266634c90.zip
merge Moritz's branch
(bzr r14855)
Diffstat (limited to 'CMakeScripts')
-rw-r--r--CMakeScripts/ConfigChecks.cmake3
-rw-r--r--CMakeScripts/DefineDependsandFlags.cmake73
2 files changed, 72 insertions, 4 deletions
diff --git a/CMakeScripts/ConfigChecks.cmake b/CMakeScripts/ConfigChecks.cmake
index 34396ef28..a247f4e72 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 8e1cf2826..f2a6b5670 100644
--- a/CMakeScripts/DefineDependsandFlags.cmake
+++ b/CMakeScripts/DefineDependsandFlags.cmake
@@ -14,12 +14,76 @@ list(APPEND INKSCAPE_INCS ${PROJECT_SOURCE_DIR}
# ----------------------------------------------------------------------------
# Files we include
# ----------------------------------------------------------------------------
-
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}/)
+
+ 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 ----------------")
endif()
-pkg_check_modules(INKSCAPE_DEP REQUIRED pangocairo pangoft2 fontconfig gthread-2.0 gsl)
+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})
@@ -33,9 +97,12 @@ if(APPLE)
pkg_check_modules(x11 REQUIRED x11)
list(APPEND INKSCAPE_LIBS ${x11_LDFLAGS})
endif()
+elseif(WIN32)
+# X11 not available on windows
else()
pkg_check_modules(x11 REQUIRED x11)
list(APPEND INKSCAPE_LIBS ${x11_LDFLAGS})
+
endif()
if(WITH_GNOME_VFS)