comparison CMakeLists.txt @ 26:b0d1308280d8

Added the PYTHON_WINDOWS_USE_RELEASE_LIBS CMake option to allow usage of debug or release Python builds when building in debug mode under Windows with Visual Studio.
author Benjamin Golinvaux <bgo@osimis.io>
date Mon, 06 Apr 2020 20:39:49 +0200
parents 3b59f5dd7e72
children ec7860ac40e9
comparison
equal deleted inserted replaced
25:3b59f5dd7e72 26:b0d1308280d8
4 set(PLUGIN_VERSION "mainline") 4 set(PLUGIN_VERSION "mainline")
5 5
6 6
7 set(PYTHON_VERSION "3.6" CACHE STRING "Version of Python to be used") 7 set(PYTHON_VERSION "3.6" CACHE STRING "Version of Python to be used")
8 set(PYTHON_WINDOWS_ROOT "" CACHE STRING "") 8 set(PYTHON_WINDOWS_ROOT "" CACHE STRING "")
9 set(PYTHON_WINDOWS_USE_RELEASE_LIBS ON CACHE BOOL "Use the release Python libraries when building with Microsoft Visual Studio, even when compiling in _DEBUG mode (set it to OFF if you require linking to a Python debug build)")
9 set(USE_SYSTEM_BOOST ON CACHE BOOL "Use the system version of Boost") 10 set(USE_SYSTEM_BOOST ON CACHE BOOL "Use the system version of Boost")
10 set(USE_SYSTEM_JSONCPP ON CACHE BOOL "Use the system version of JsonCpp") 11 set(USE_SYSTEM_JSONCPP ON CACHE BOOL "Use the system version of JsonCpp")
11 set(USE_LEGACY_JSONCPP OFF CACHE BOOL "Use the old branch 0.x.y of JsonCpp, that does not require a C++11 compiler (for LSB and old versions of Visual Studio)") 12 set(USE_LEGACY_JSONCPP OFF CACHE BOOL "Use the old branch 0.x.y of JsonCpp, that does not require a C++11 compiler (for LSB and old versions of Visual Studio)")
12 13
13 include(CheckIncludeFile) 14 include(CheckIncludeFile)
26 27
27 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") 28 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
28 if (MSVC) 29 if (MSVC)
29 set(Prefix "") 30 set(Prefix "")
30 set(Suffix ".lib") 31 set(Suffix ".lib")
32 if(PYTHON_WINDOWS_USE_RELEASE_LIBS)
33 add_definitions(-DORTHANC_PYTHON_WINDOWS_USE_RELEASE_LIBS=1)
34 endif()
31 else() 35 else()
32 list(GET CMAKE_FIND_LIBRARY_PREFIXES 0 Prefix) 36 list(GET CMAKE_FIND_LIBRARY_PREFIXES 0 Prefix)
33 set(Suffix ".a") 37 set(Suffix ".a")
34 endif() 38 endif()
35 39
75 set(WINDOWS_RESOURCES ${CMAKE_CURRENT_BINARY_DIR}/Version.rc) 79 set(WINDOWS_RESOURCES ${CMAKE_CURRENT_BINARY_DIR}/Version.rc)
76 endif() 80 endif()
77 81
78 82
79 include_directories( 83 include_directories(
84 #${CMAKE_SOURCE_DIR}/Sources
80 ${ORTHANC_ROOT}/Sdk-1.5.7 85 ${ORTHANC_ROOT}/Sdk-1.5.7
81 ) 86 )
82 87
83 add_definitions( 88 add_definitions(
84 -DHAS_ORTHANC_EXCEPTION=0 89 -DHAS_ORTHANC_EXCEPTION=0