Mercurial > hg > orthanc-python
annotate CMakeLists.txt @ 4:e3128420249d
fixing the SDK version
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 27 Mar 2020 12:22:22 +0100 |
parents | 7ed502b17b8f |
children | 952e969a2240 |
rev | line source |
---|---|
0 | 1 cmake_minimum_required(VERSION 2.8) |
2 project(OrthancPython) | |
3 | |
4 set(PLUGIN_VERSION "mainline") | |
5 | |
6 | |
7 set(PYTHON_VERSION "3.6" CACHE STRING "Version of Python to be used") | |
8 set(PYTHON_WINDOWS_ROOT "" CACHE STRING "") | |
9 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_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 include(CheckIncludeFile) | |
14 include(CheckIncludeFileCXX) | |
15 include(CheckIncludeFiles) | |
16 include(CheckLibraryExists) | |
17 | |
18 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") | |
19 set(PYTHON_INCLUDE_DIRS ${PYTHON_WINDOWS_ROOT}/include) | |
20 set(PYTHON_LIBRARIES ${PYTHON_WINDOWS_ROOT}/libs/libpython27.a) | |
21 | |
22 else() | |
23 find_package(PkgConfig REQUIRED) | |
24 pkg_check_modules(PYTHON_1 python-${PYTHON_VERSION}-embed) | |
25 | |
26 if (PYTHON_1_FOUND) | |
27 set(PYTHON_INCLUDE_DIRS ${PYTHON_1_INCLUDE_DIRS}) | |
28 set(PYTHON_LIBRARIES ${PYTHON_1_LIBRARIES}) | |
29 else() | |
30 pkg_check_modules(PYTHON_2 REQUIRED python-${PYTHON_VERSION}) | |
31 set(PYTHON_INCLUDE_DIRS ${PYTHON_2_INCLUDE_DIRS}) | |
32 set(PYTHON_LIBRARIES ${PYTHON_2_LIBRARIES}) | |
33 endif() | |
34 endif() | |
35 | |
36 set(ORTHANC_ROOT ${CMAKE_SOURCE_DIR}/Resources/Orthanc) | |
37 include(${ORTHANC_ROOT}/Resources/CMake/Compiler.cmake) | |
38 include(${ORTHANC_ROOT}/Resources/CMake/DownloadPackage.cmake) | |
39 include(${ORTHANC_ROOT}/Resources/CMake/BoostConfiguration.cmake) | |
40 include(${ORTHANC_ROOT}/Resources/CMake/JsonCppConfiguration.cmake) | |
41 | |
4
e3128420249d
fixing the SDK version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
42 include_directories( |
e3128420249d
fixing the SDK version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
43 ${ORTHANC_ROOT}/Sdk-1.5.7 |
e3128420249d
fixing the SDK version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
44 ) |
0 | 45 |
46 add_definitions( | |
47 -DHAS_ORTHANC_EXCEPTION=0 | |
48 ) | |
49 | |
50 include_directories( | |
51 ${ORTHANC_ROOT}/Plugins/Include | |
52 ${ORTHANC_ROOT}/Plugins/Samples/Common | |
53 ${PYTHON_INCLUDE_DIRS} | |
54 ) | |
55 | |
56 add_library(OrthancPython SHARED | |
57 ${BOOST_SOURCES} | |
58 ${JSONCPP_SOURCES} | |
59 ${ORTHANC_ROOT}/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp | |
60 Sources/Autogenerated/sdk.cpp | |
61 Sources/OnChangeCallback.cpp | |
62 Sources/OnStoredInstanceCallback.cpp | |
63 Sources/Plugin.cpp | |
64 Sources/PythonFunction.cpp | |
65 Sources/PythonLock.cpp | |
66 Sources/PythonModule.cpp | |
67 Sources/PythonObject.cpp | |
68 Sources/PythonString.cpp | |
69 Sources/RestCallbacks.cpp | |
70 ) | |
71 | |
72 target_link_libraries(OrthancPython ${PYTHON_LIBRARIES}) | |
73 | |
74 add_definitions(-DPLUGIN_VERSION="${PLUGIN_VERSION}") | |
75 | |
76 set_target_properties(OrthancPython PROPERTIES | |
77 VERSION ${PLUGIN_VERSION} | |
78 SOVERSION ${PLUGIN_VERSION} | |
79 ) | |
80 | |
81 install( | |
82 TARGETS OrthancPython | |
83 RUNTIME DESTINATION lib # Destination for Windows | |
84 LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux | |
85 ) |