annotate OrthancFramework/SharedLibrary/CMakeLists.txt @ 4097:99e2054d1e8d

fix unit tests for orthanc framework
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 01 Jul 2020 11:15:29 +0200
parents 1c89208fbba9
children 90eaf36e6adf
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4063
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 ## To see all the exported symbols in the DLL:
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 ##
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 ## $ i686-w64-mingw32-objdump -p ./libOrthancFramework.dll
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 ##
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 ## IMPORTANT: "-static-libgcc" prevents catching exception in the
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 ## .EXE, which makes throwing exceptions crash the software!
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 ##
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 cmake_minimum_required(VERSION 2.8)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 project(OrthancFramework)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13
4066
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
14
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
15
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
16 #####################################################################
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
17 ## Additional parameters
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
18 #####################################################################
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
19
4063
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 # *Do not* use CMAKE_INSTALL_PREFIX, otherwise CMake automatically
4066
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
21 # adds CMAKE_INSTALL_PREFIX to the include_directories(), which causes
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
22 # issues if re-building the shared library after install!
4063
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 set(ORTHANC_INSTALL_DIR "/tmp/install" CACHE PATH "")
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 SET(UNIT_TESTS_WITH_HTTP_CONNEXIONS ON CACHE BOOL "Allow unit tests to make HTTP requests")
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26
4066
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
27
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
28 #####################################################################
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
29 ## Configuration of the Orthanc framework
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
30 #####################################################################
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
31
4063
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 # This must be before inclusion of "OrthancFrameworkParameters.cmake" to take effect
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 if (CMAKE_SYSTEM_NAME STREQUAL "Windows" AND
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 CMAKE_COMPILER_IS_GNUCXX) # MinGW
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 set(DYNAMIC_MINGW_STDLIB ON) # Disable static linking against libc (to throw exceptions)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libstdc++")
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 endif()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 include(${CMAKE_SOURCE_DIR}/../Resources/CMake/OrthancFrameworkParameters.cmake)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40
4094
1c89208fbba9 fix build of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4071
diff changeset
41 if (STATIC_BUILD OR NOT USE_SYSTEM_DCMTK)
1c89208fbba9 fix build of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4071
diff changeset
42 set(STANDALONE_BUILD ON)
1c89208fbba9 fix build of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4071
diff changeset
43 else()
1c89208fbba9 fix build of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4071
diff changeset
44 set(STANDALONE_BUILD OFF)
1c89208fbba9 fix build of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4071
diff changeset
45 endif()
1c89208fbba9 fix build of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4071
diff changeset
46
4063
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 set(ENABLE_DCMTK ON)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 set(ENABLE_DCMTK_TRANSCODING ON)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 set(ENABLE_GOOGLE_TEST ON)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 set(ENABLE_JPEG ON)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 set(ENABLE_LOCALE ON)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 set(ENABLE_LUA ON)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 set(ENABLE_PNG ON)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 set(ENABLE_PUGIXML ON)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 set(ENABLE_ZLIB ON)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 # WebAssembly or asm.js
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 set(BOOST_LOCALE_BACKEND "libiconv")
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 set(ORTHANC_SANDBOXED ON)
4071
d6b7fb0f9652 improved DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4067
diff changeset
61 set(STANDALONE_BUILD ON)
4063
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62
4067
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4066
diff changeset
63 # Will be used by "../Resources/CMake/EmscriptenParameters.cmake"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4066
diff changeset
64 set(WASM_FLAGS "-s SIDE_MODULE=1 -s EXPORT_ALL=1")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4066
diff changeset
65
4063
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 else()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 # Enable all the remaining modules for other targets
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 set(ENABLE_CRYPTO_OPTIONS ON)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 set(ENABLE_DCMTK_NETWORKING ON)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 set(ENABLE_OPENSSL_ENGINES ON)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 set(ENABLE_SQLITE ON)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 set(ENABLE_WEB_CLIENT ON)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 set(ENABLE_WEB_SERVER ON)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 set(BOOST_LOCALE_BACKEND "icu")
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 endif()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 set(ORTHANC_BUILDING_FRAMEWORK_LIBRARY ON)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 # Don't use the version script that is reserved for plugins
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 set(ENABLE_PLUGINS_VERSION_SCRIPT OFF)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 include(${CMAKE_SOURCE_DIR}/../Resources/CMake/OrthancFrameworkConfiguration.cmake)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85
4066
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
86
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
87
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
88 #####################################################################
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
89 ## Configuration the visibility of the third-party libraries in the
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
90 ## shared library
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
91 #####################################################################
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
92
4063
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93 if (STATIC_BUILD OR NOT USE_SYSTEM_JSONCPP)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94 set(ORTHANC_STATIC_JSONCPP ON)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 else()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 set(ORTHANC_STATIC_JSONCPP OFF)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 endif()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 if (STATIC_BUILD OR NOT USE_SYSTEM_BOOST)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 set(ORTHANC_STATIC_BOOST ON)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101 else()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 set(ORTHANC_STATIC_BOOST OFF)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103 endif()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105 if (STATIC_BUILD OR NOT USE_SYSTEM_SQLITE)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
106 set(ORTHANC_STATIC_SQLITE ON)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107 else()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108 set(ORTHANC_STATIC_SQLITE OFF)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109 endif()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
111 if (STATIC_BUILD OR NOT USE_SYSTEM_PUGIXML)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112 set(ORTHANC_STATIC_PUGIXML ON)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113 else()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 set(ORTHANC_STATIC_PUGIXML OFF)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115 endif()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116
4065
d6362b2c4b61 export dcmdata in shared library, rounding in convolution tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
117 if (STATIC_BUILD OR NOT USE_SYSTEM_DCMTK)
d6362b2c4b61 export dcmdata in shared library, rounding in convolution tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
118 set(ORTHANC_STATIC_DCMTK ON)
d6362b2c4b61 export dcmdata in shared library, rounding in convolution tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
119 else()
d6362b2c4b61 export dcmdata in shared library, rounding in convolution tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
120 set(ORTHANC_STATIC_DCMTK OFF)
d6362b2c4b61 export dcmdata in shared library, rounding in convolution tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
121 endif()
d6362b2c4b61 export dcmdata in shared library, rounding in convolution tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
122
4063
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124 if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125 CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127 # Control the visibility of JsonCpp
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128 if (ORTHANC_STATIC_JSONCPP)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130 set_source_files_properties(${JSONCPP_SOURCES}
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 PROPERTIES COMPILE_DEFINITIONS "JSON_API=__declspec(dllexport)"
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132 )
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133 set(ORTHANC_JSON_API "__declspec(dllimport)")
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134 else()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135 set(ORTHANC_JSON_API "__attribute__((visibility(\"default\")))")
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136 set_source_files_properties(${JSONCPP_SOURCES}
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137 PROPERTIES COMPILE_DEFINITIONS "JSON_API=${ORTHANC_JSON_API}"
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 )
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139 endif()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140 endif()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142 # Control the visibility of SQLite
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143 if (ORTHANC_STATIC_SQLITE)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145 set_source_files_properties(${SQLITE_SOURCES}
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146 PROPERTIES COMPILE_DEFINITIONS "SQLITE_API=__declspec(dllexport)"
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147 )
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148 set(ORTHANC_SQLITE_API "__declspec(dllimport)")
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149 else()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150 set(ORTHANC_SQLITE_API "__attribute__((visibility(\"default\")))")
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151 set_source_files_properties(${SQLITE_SOURCES}
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152 PROPERTIES COMPILE_DEFINITIONS "SQLITE_API=${ORTHANC_SQLITE_API}"
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153 )
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154 endif()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155 endif()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157 # Control the visibility of Boost
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows" AND
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 ORTHANC_STATIC_BOOST)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160 set_source_files_properties(${ORTHANC_CORE_SOURCES_INTERNAL}
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161 PROPERTIES COMPILE_DEFINITIONS "BOOST_DATE_TIME_SOURCE;BOOST_FILESYSTEM_SOURCE;BOOST_LOCALE_SOURCE;BOOST_REGEX_SOURCE"
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
162 )
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163 endif()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165 # Control the visibility of Pugixml
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
166 if (ORTHANC_STATIC_PUGIXML)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
167 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
168 set_source_files_properties(${PUGIXML_SOURCES}
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
169 PROPERTIES COMPILE_DEFINITIONS "PUGIXML_API=__declspec(dllexport)"
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
170 )
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
171 set(ORTHANC_PUGIXML_API "__declspec(dllimport)")
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
172 else()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
173 set(ORTHANC_PUGIXML_API "__attribute__((visibility(\"default\")))")
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
174 set_source_files_properties(${PUGIXML_SOURCES}
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
175 PROPERTIES COMPILE_DEFINITIONS "PUGIXML_API=${ORTHANC_PUGIXML_API}"
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
176 )
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
177 endif()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
178 endif()
4065
d6362b2c4b61 export dcmdata in shared library, rounding in convolution tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
179
d6362b2c4b61 export dcmdata in shared library, rounding in convolution tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
180 # Control the visibility of DCMTK: We only export the "dcmdata" module
d6362b2c4b61 export dcmdata in shared library, rounding in convolution tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
181 if (ORTHANC_STATIC_DCMTK)
d6362b2c4b61 export dcmdata in shared library, rounding in convolution tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
182 set_source_files_properties(${DCMTK_SOURCES}
d6362b2c4b61 export dcmdata in shared library, rounding in convolution tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
183 PROPERTIES COMPILE_DEFINITIONS "DCMTK_BUILD_IN_PROGRESS;DCMTK_BUILD_SINGLE_SHARED_LIBRARY;DCMTK_SHARED;HAVE_HIDDEN_VISIBILITY;dcmdata_EXPORTS"
d6362b2c4b61 export dcmdata in shared library, rounding in convolution tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
184 )
d6362b2c4b61 export dcmdata in shared library, rounding in convolution tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
185 endif()
4063
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
186 endif()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
187
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
188
4066
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
189 add_definitions(
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
190 -DCIVETWEB_API= # Don't export the public symbols from CivetWeb
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
191 )
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
192
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
193
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
194
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
195 #####################################################################
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
196 ## Building the shared library
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
197 #####################################################################
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
198
4063
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
199 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
200 execute_process(
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
201 COMMAND
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
202 ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/../Resources/WindowsResources.py
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
203 ${ORTHANC_VERSION} "OrthancFramework" OrthancFramework.dll "Shared library containing the Orthanc framework"
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
204 ERROR_VARIABLE Failure
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
205 OUTPUT_FILE ${AUTOGENERATED_DIR}/Version.rc
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
206 )
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
207
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
208 if (Failure)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
209 message(FATAL_ERROR "Error while computing the version information: ${Failure}")
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
210 endif()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
211
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
212 list(APPEND AUTOGENERATED_SOURCES ${AUTOGENERATED_DIR}/Version.rc)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
213 endif()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
214
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
215
4066
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
216 # Those two files collide with each other, and thus are merged into a
4063
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
217 # single "DllMain.cpp"
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
218 list(REMOVE_ITEM ORTHANC_CORE_SOURCES
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
219 ${BOOST_SOURCES_DIR}/libs/thread/src/win32/tss_dll.cpp
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
220 ${OPENSSL_SOURCES_DIR}/crypto/dllmain.c
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
221 )
4066
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
222
4063
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
223 if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
224 # In WebAssembly, a SIDE_MODULE is an executable
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
225 add_executable(OrthancFramework
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
226 ${AUTOGENERATED_SOURCES}
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
227 ${ORTHANC_CORE_SOURCES}
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
228 ${ORTHANC_DICOM_SOURCES}
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
229 )
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
230
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
231 # CMake does not natively handle SIDE_MODULE, and believes that
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
232 # Emscripten produces a ".js" file (whereas it creates only the
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
233 # ".wasm"). Create a dummy ".js" for target to work.
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
234 add_custom_command(
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
235 TARGET OrthancFramework POST_BUILD
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
236 COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/OrthancFramework.js
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
237 )
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
238 else()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
239 add_library(OrthancFramework SHARED
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
240 ${AUTOGENERATED_SOURCES}
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
241 ${ORTHANC_CORE_SOURCES}
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
242 ${ORTHANC_DICOM_SOURCES}
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
243 DllMain.cpp
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
244 )
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
245 endif()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
246
4066
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
247
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
248 if (NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
249 # By default, hide all the symbols
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
250 set_target_properties(OrthancFramework PROPERTIES C_VISIBILITY_PRESET hidden)
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
251 set_target_properties(OrthancFramework PROPERTIES CXX_VISIBILITY_PRESET hidden)
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
252
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
253 # Configure the version of the shared library
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
254 set_target_properties(
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
255 OrthancFramework PROPERTIES
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
256 VERSION ${ORTHANC_VERSION}
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
257 SOVERSION ${ORTHANC_VERSION}
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
258 )
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
259 endif()
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
260
4063
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
261
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
262 target_link_libraries(OrthancFramework ${DCMTK_LIBRARIES})
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
263
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
264 if (LIBICU_LIBRARIES)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
265 target_link_libraries(OrthancFramework ${LIBICU_LIBRARIES})
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
266 endif()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
267
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
268 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
269 target_link_libraries(OrthancFramework winpthread)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
270 endif()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
271
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
272
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
273
4066
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
274 #####################################################################
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
275 ## Publish the headers into the "Include" folder of the build
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
276 ## directory
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
277 #####################################################################
4063
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
278
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
279 file(
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
280 COPY ${CMAKE_SOURCE_DIR}/../Sources/
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
281 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/Include/orthanc-framework
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
282 NO_SOURCE_PERMISSIONS
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
283 FILES_MATCHING
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
284 PATTERN "*.h"
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
285 PATTERN OrthancFramework.h EXCLUDE
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
286 )
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
287
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
288 configure_file(
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
289 ${CMAKE_SOURCE_DIR}/OrthancFramework.h.in
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
290 ${CMAKE_CURRENT_BINARY_DIR}/Include/orthanc-framework/OrthancFramework.h
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
291 )
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
292
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
293
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
294 if (ORTHANC_STATIC_BOOST)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
295 file(
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
296 COPY ${BOOST_SOURCES_DIR}/boost/
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
297 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/Include/boost/
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
298 NO_SOURCE_PERMISSIONS
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
299 FILES_MATCHING
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
300 PATTERN "*.h"
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
301 PATTERN "*.hpp"
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
302 PATTERN "*.ipp"
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
303 )
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
304 endif()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
305
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
306
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
307 if (ENABLE_SQLITE AND ORTHANC_STATIC_SQLITE)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
308 file(
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
309 COPY ${SQLITE_SOURCES_DIR}/
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
310 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/Include/
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
311 NO_SOURCE_PERMISSIONS
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
312 FILES_MATCHING
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
313 PATTERN "*.h"
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
314 )
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
315 endif()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
316
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
317
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
318 if (ORTHANC_STATIC_JSONCPP)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
319 file(
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
320 COPY ${JSONCPP_SOURCES_DIR}/include/json/
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
321 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/Include/json/
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
322 NO_SOURCE_PERMISSIONS
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
323 FILES_MATCHING
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
324 PATTERN "*.h"
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
325 )
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
326 endif()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
327
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
328
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
329 if (ENABLE_DCMTK AND (STATIC_BUILD OR NOT USE_SYSTEM_DCMTK))
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
330 file(
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
331 COPY ${DCMTK_SOURCES_DIR}/dcmdata/include/dcmtk/dcmdata/
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
332 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/Include/dcmtk/dcmdata/
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
333 NO_SOURCE_PERMISSIONS
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
334 FILES_MATCHING
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
335 PATTERN "*.h"
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
336 )
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
337
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
338 file(
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
339 COPY ${DCMTK_SOURCES_DIR}/config/include/dcmtk/config/
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
340 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/Include/dcmtk/config/
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
341 NO_SOURCE_PERMISSIONS
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
342 FILES_MATCHING
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
343 PATTERN "*.h"
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
344 )
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
345
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
346 file(
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
347 COPY ${DCMTK_SOURCES_DIR}/ofstd/include/dcmtk/ofstd/
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
348 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/Include/dcmtk/ofstd/
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
349 NO_SOURCE_PERMISSIONS
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
350 FILES_MATCHING
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
351 PATTERN "*.h"
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
352 )
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
353
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
354 file(
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
355 COPY ${DCMTK_SOURCES_DIR}/oflog/include/dcmtk/oflog/
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
356 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/Include/dcmtk/oflog/
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
357 NO_SOURCE_PERMISSIONS
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
358 FILES_MATCHING
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
359 PATTERN "*.h"
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
360 )
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
361 endif()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
362
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
363
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
364 if (ENABLE_PUGIXML AND (STATIC_BUILD OR NOT USE_SYSTEM_PUGIXML))
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
365 file(
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
366 COPY ${PUGIXML_SOURCES_DIR}/src/
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
367 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/Include/
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
368 NO_SOURCE_PERMISSIONS
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
369 FILES_MATCHING
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
370 PATTERN "*.hpp"
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
371 )
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
372 endif()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
373
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
374
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
375 if (ENABLE_LUA AND (STATIC_BUILD OR NOT USE_SYSTEM_LUA))
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
376 file(
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
377 COPY ${LUA_SOURCES_DIR}/src/
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
378 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/Include/
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
379 NO_SOURCE_PERMISSIONS
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
380 FILES_MATCHING
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
381 PATTERN "*.h"
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
382 )
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
383 endif()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
384
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
385
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
386 if (OFF)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
387 # These files are fully abstracted by the Orthanc Framework classes
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
388 if (ENABLE_PNG AND (STATIC_BUILD OR NOT USE_SYSTEM_LIBPNG))
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
389 file(
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
390 COPY ${LIBPNG_SOURCES_DIR}/
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
391 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/Include/
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
392 NO_SOURCE_PERMISSIONS
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
393 FILES_MATCHING
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
394 PATTERN "*.h"
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
395 )
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
396 endif()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
397
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
398 if (ENABLE_ZLIB AND (STATIC_BUILD OR NOT USE_SYSTEM_ZLIB))
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
399 file(
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
400 COPY ${ZLIB_SOURCES_DIR}/
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
401 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/Include/
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
402 NO_SOURCE_PERMISSIONS
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
403 FILES_MATCHING
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
404 PATTERN "*.h"
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
405 )
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
406 endif()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
407
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
408 if (ENABLE_JPEG AND (STATIC_BUILD OR NOT USE_SYSTEM_LIBJPEG))
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
409 file(
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
410 COPY ${LIBJPEG_SOURCES_DIR}/
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
411 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/Include/
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
412 NO_SOURCE_PERMISSIONS
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
413 FILES_MATCHING
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
414 PATTERN "*.h"
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
415 )
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
416 endif()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
417
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
418 if (ENABLE_WEB_CLIENT AND (STATIC_BUILD OR NOT USE_SYSTEM_CURL))
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
419 file(
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
420 COPY ${CURL_SOURCES_DIR}/include/curl/
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
421 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/Include/curl/
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
422 NO_SOURCE_PERMISSIONS
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
423 FILES_MATCHING
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
424 PATTERN "*.h"
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
425 )
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
426 endif()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
427 endif()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
428
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
429
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
430
4066
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
431 #####################################################################
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
432 ## Possibly install the headers and the binaries
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
433 #####################################################################
4063
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
434
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
435 install(
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
436 TARGETS OrthancFramework
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
437 RUNTIME DESTINATION ${ORTHANC_INSTALL_DIR}/lib # Destination for Windows
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
438 LIBRARY DESTINATION ${ORTHANC_INSTALL_DIR}/lib # Destination for Linux
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
439 )
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
440
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
441 if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
442 install(FILES
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
443 ${CMAKE_CURRENT_BINARY_DIR}/OrthancFramework.wasm
4066
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
444 DESTINATION ${ORTHANC_INSTALL_DIR}/lib
4063
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
445 )
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
446 endif()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
447
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
448 install(
4066
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
449 DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Include/
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
450 DESTINATION ${ORTHANC_INSTALL_DIR}/include/
4063
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
451 )
4066
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
452
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
453
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
454
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
455 #####################################################################
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
456 ## Compile the unit tests
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
457 #####################################################################
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
458
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
459 if (NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
460 include(ExternalProject)
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
461
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
462 if (CMAKE_TOOLCHAIN_FILE)
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
463 # Take absolute path to the toolchain
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
464 get_filename_component(TMP ${CMAKE_TOOLCHAIN_FILE} REALPATH BASE ${CMAKE_SOURCE_DIR}/..)
4097
99e2054d1e8d fix unit tests for orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4094
diff changeset
465 list(APPEND Flags
99e2054d1e8d fix unit tests for orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4094
diff changeset
466 -DCMAKE_TOOLCHAIN_FILE=${TMP}
99e2054d1e8d fix unit tests for orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4094
diff changeset
467 -DLSB_CC=${LSB_CC}
99e2054d1e8d fix unit tests for orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4094
diff changeset
468 -DLSB_CXX=${LSB_CXX}
99e2054d1e8d fix unit tests for orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4094
diff changeset
469 )
4066
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
470 endif()
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
471
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
472 # Build the unit tests, linking them against the just-created
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
473 # "OrthancFramework" library
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
474 externalproject_add(UnitTests
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
475 SOURCE_DIR "${CMAKE_SOURCE_DIR}/../UnitTestsSources"
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
476 CMAKE_ARGS
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
477 -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
478 -DORTHANC_FRAMEWORK_LIBDIR:PATH=${CMAKE_CURRENT_BINARY_DIR}
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
479 -DORTHANC_FRAMEWORK_ROOT:PATH=${CMAKE_CURRENT_BINARY_DIR}/Include/orthanc-framework
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
480 -DORTHANC_FRAMEWORK_SOURCE:STRING=system
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
481 -DORTHANC_FRAMEWORK_STATIC:BOOL=${STATIC_BUILD}
4094
1c89208fbba9 fix build of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4071
diff changeset
482
1c89208fbba9 fix build of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4071
diff changeset
483 -DALLOW_DOWNLOADS:BOOL=${ALLOW_DOWNLOADS}
1c89208fbba9 fix build of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4071
diff changeset
484 -DSTATIC_BUILD:BOOL=${STATIC_BUILD}
4066
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
485 -DUNIT_TESTS_WITH_HTTP_CONNEXIONS:BOOL=${UNIT_TESTS_WITH_HTTP_CONNEXIONS}
4094
1c89208fbba9 fix build of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4071
diff changeset
486 -DUSE_GOOGLE_TEST_DEBIAN_PACKAGE:BOOL=${USE_GOOGLE_TEST_DEBIAN_PACKAGE}
1c89208fbba9 fix build of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4071
diff changeset
487 -DUSE_SYSTEM_GOOGLE_TEST:BOOL=${USE_SYSTEM_GOOGLE_TEST}
1c89208fbba9 fix build of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4071
diff changeset
488 -DUSE_SYSTEM_JSONCPP:BOOL=${USE_SYSTEM_JSONCPP}
4066
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
489 ${Flags}
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
490 )
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
491
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
492 add_dependencies(UnitTests OrthancFramework)
3a59a021b5de build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4065
diff changeset
493 endif()