comparison CMakeLists.txt @ 29:a0af5a8182a8

sync, removed old patch for Orthanc framework 1.5.6
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 04 Aug 2020 14:26:01 +0200
parents 065bc476bcdc
children 3abebab5d004
comparison
equal deleted inserted replaced
28:b7e32fe4973b 29:a0af5a8182a8
18 cmake_minimum_required(VERSION 2.8) 18 cmake_minimum_required(VERSION 2.8)
19 project(OrthancTransfers) 19 project(OrthancTransfers)
20 20
21 set(ORTHANC_PLUGIN_VERSION "mainline") 21 set(ORTHANC_PLUGIN_VERSION "mainline")
22 22
23 if (ORTHANC_PLUGIN_VERSION STREQUAL "mainline") 23 if (ORTHANC_PLUGIN_VERSION STREQUAL "mainlinea")
24 set(ORTHANC_FRAMEWORK_VERSION "mainline") 24 set(ORTHANC_FRAMEWORK_VERSION "mainline")
25 set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "hg") 25 set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "hg")
26 else() 26 else()
27 set(ORTHANC_FRAMEWORK_VERSION "1.5.6") 27 set(ORTHANC_FRAMEWORK_VERSION "1.7.2")
28 set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "web") 28 set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "web")
29
30 # diff --new-file -urEb Orthanc-1.5.6.orig/ Orthanc-1.5.6 > orthanc-1.5.6.patch
31 set(ORTHANC_FRAMEWORK_PATCH "${CMAKE_SOURCE_DIR}/Resources/Patches/orthanc-1.5.6.patch")
32 endif() 29 endif()
33 30
34 31
35 # Parameters of the build 32 # Parameters of the build
36 set(ORTHANC_FRAMEWORK_SOURCE "${ORTHANC_FRAMEWORK_DEFAULT_SOURCE}" CACHE STRING "Source of the Orthanc source code (can be \"hg\", \"archive\", \"web\" or \"path\")") 33 set(ORTHANC_FRAMEWORK_SOURCE "${ORTHANC_FRAMEWORK_DEFAULT_SOURCE}" CACHE STRING "Source of the Orthanc source code (can be \"hg\", \"archive\", \"web\" or \"path\")")
43 40
44 41
45 # Download and setup the Orthanc framework 42 # Download and setup the Orthanc framework
46 include(${CMAKE_SOURCE_DIR}/Resources/Orthanc/CMake/DownloadOrthancFramework.cmake) 43 include(${CMAKE_SOURCE_DIR}/Resources/Orthanc/CMake/DownloadOrthancFramework.cmake)
47 44
45 include_directories(${ORTHANC_FRAMEWORK_ROOT})
46
48 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "system") 47 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "system")
49 link_libraries(${ORTHANC_FRAMEWORK_LIBRARIES}) 48 link_libraries(${ORTHANC_FRAMEWORK_LIBRARIES})
50 49
51 set(USE_SYSTEM_GOOGLE_TEST ON CACHE BOOL "Use the system version of Google Test") 50 set(USE_SYSTEM_GOOGLE_TEST ON CACHE BOOL "Use the system version of Google Test")
52 set(USE_GOOGLE_TEST_DEBIAN_PACKAGE OFF CACHE BOOL "Use the sources of Google Test shipped with libgtest-dev (Debian only)") 51 set(USE_GOOGLE_TEST_DEBIAN_PACKAGE OFF CACHE BOOL "Use the sources of Google Test shipped with libgtest-dev (Debian only)")
53 mark_as_advanced(USE_GOOGLE_TEST_DEBIAN_PACKAGE) 52 mark_as_advanced(USE_GOOGLE_TEST_DEBIAN_PACKAGE)
54 include(${CMAKE_SOURCE_DIR}/Resources/Orthanc/CMake/GoogleTestConfiguration.cmake) 53 include(${CMAKE_SOURCE_DIR}/Resources/Orthanc/CMake/GoogleTestConfiguration.cmake)
55 54
56 else() 55 else()
57 include(${ORTHANC_FRAMEWORK_ROOT}/Resources/CMake/OrthancFrameworkParameters.cmake) 56 include(${ORTHANC_FRAMEWORK_ROOT}/../Resources/CMake/OrthancFrameworkParameters.cmake)
58 57
59 set(ENABLE_LOCALE OFF) # Disable support for locales (notably in Boost) 58 set(ENABLE_LOCALE OFF) # Disable support for locales (notably in Boost)
60 set(ENABLE_GOOGLE_TEST ON) 59 set(ENABLE_GOOGLE_TEST ON)
61 set(ENABLE_MODULE_IMAGES OFF) 60 set(ENABLE_MODULE_IMAGES OFF)
62 set(ENABLE_MODULE_JOBS OFF) 61 set(ENABLE_MODULE_JOBS OFF)
63 set(ENABLE_MODULE_DICOM OFF) 62 set(ENABLE_MODULE_DICOM OFF)
64 set(ENABLE_ZLIB ON) 63 set(ENABLE_ZLIB ON)
65 64
66 include(${ORTHANC_FRAMEWORK_ROOT}/Resources/CMake/OrthancFrameworkConfiguration.cmake) 65 include(${ORTHANC_FRAMEWORK_ROOT}/../Resources/CMake/OrthancFrameworkConfiguration.cmake)
67 include_directories(
68 ${ORTHANC_FRAMEWORK_ROOT}/Sources
69 )
70 endif() 66 endif()
71 67
72 68
73 include(${CMAKE_SOURCE_DIR}/Resources/Orthanc/Plugins/OrthancPluginsExports.cmake) 69 include(${CMAKE_SOURCE_DIR}/Resources/Orthanc/Plugins/OrthancPluginsExports.cmake)
74
75
76 # Possibly patch the Orthanc framework
77 if (DEFINED ORTHANC_FRAMEWORK_PATCH AND
78 NOT EXISTS "${ORTHANC_FRAMEWORK_ROOT}/patched")
79 execute_process(
80 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i ${ORTHANC_FRAMEWORK_PATCH}
81 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
82 RESULT_VARIABLE Failure
83 )
84
85 if (Failure)
86 message(FATAL_ERROR "Error while patching a file")
87 endif()
88 endif()
89 70
90 71
91 # Check that the Orthanc SDK headers are available 72 # Check that the Orthanc SDK headers are available
92 if (STATIC_BUILD OR NOT USE_SYSTEM_ORTHANC_SDK) 73 if (STATIC_BUILD OR NOT USE_SYSTEM_ORTHANC_SDK)
93 if (ORTHANC_SDK_VERSION STREQUAL "1.4.2") 74 if (ORTHANC_SDK_VERSION STREQUAL "1.4.2")
105 86
106 87
107 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") 88 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
108 execute_process( 89 execute_process(
109 COMMAND 90 COMMAND
110 ${PYTHON_EXECUTABLE} ${ORTHANC_FRAMEWORK_ROOT}/Resources/WindowsResources.py 91 ${PYTHON_EXECUTABLE} ${ORTHANC_FRAMEWORK_ROOT}/../Resources/WindowsResources.py
111 ${ORTHANC_PLUGIN_VERSION} "TransfersAccelerator index plugin" OrthancTransfers.dll 92 ${ORTHANC_PLUGIN_VERSION} "TransfersAccelerator index plugin" OrthancTransfers.dll
112 "TransfersAccelerator as a database back-end to Orthanc (index)" 93 "TransfersAccelerator as a database back-end to Orthanc (index)"
113 ERROR_VARIABLE Failure 94 ERROR_VARIABLE Failure
114 OUTPUT_FILE ${AUTOGENERATED_DIR}/Version.rc 95 OUTPUT_FILE ${AUTOGENERATED_DIR}/Version.rc
115 ) 96 )