annotate CMakeLists.txt @ 3790:59704c124722

fix typo in plugin SDK
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 21 Mar 2020 16:20:43 +0100
parents 875308321fa8
children 3b5feb2bbd4b 4f78da5613a1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2691
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
1 cmake_minimum_required(VERSION 2.8)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
3 project(Orthanc)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
4
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
5
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
6 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
7 ## Generic parameters of the Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
8 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
9
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
10 include(${CMAKE_SOURCE_DIR}/Resources/CMake/OrthancFrameworkParameters.cmake)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
11
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
12 # Enable all the optional components of the Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
13 set(ENABLE_CRYPTO_OPTIONS ON)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
14 set(ENABLE_DCMTK ON)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
15 set(ENABLE_DCMTK_NETWORKING ON)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
16 set(ENABLE_GOOGLE_TEST ON)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
17 set(ENABLE_JPEG ON)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
18 set(ENABLE_LOCALE ON)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
19 set(ENABLE_LUA ON)
3723
cc6d4edfe8fe fix pkcs11 compilation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3633
diff changeset
20 set(ENABLE_OPENSSL_ENGINES ON) # OpenSSL engines are necessary for PKCS11
2691
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
21 set(ENABLE_PNG ON)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
22 set(ENABLE_PUGIXML ON)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
23 set(ENABLE_SQLITE ON)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
24 set(ENABLE_WEB_CLIENT ON)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
25 set(ENABLE_WEB_SERVER ON)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
26 set(ENABLE_ZLIB ON)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
27
3743
33c19a6643e1 creating IDicomTranscoder abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3723
diff changeset
28 # To test transcoding
33c19a6643e1 creating IDicomTranscoder abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3723
diff changeset
29 #set(ENABLE_DCMTK_TRANSCODING ON)
33c19a6643e1 creating IDicomTranscoder abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3723
diff changeset
30
2691
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
31 set(HAS_EMBEDDED_RESOURCES ON)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
32
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
33
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
34 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
35 ## CMake parameters tunable at the command line to configure the
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
36 ## plugins, the companion tools, and the unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
37 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
38
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
39 # Parameters of the build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
40 SET(BUILD_MODALITY_WORKLISTS ON CACHE BOOL "Whether to build the sample plugin to serve modality worklists")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
41 SET(BUILD_RECOVER_COMPRESSED_FILE ON CACHE BOOL "Whether to build the companion tool to recover files compressed using Orthanc")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
42 SET(BUILD_SERVE_FOLDERS ON CACHE BOOL "Whether to build the ServeFolders plugin")
3622
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
43 SET(BUILD_CONNECTIVITY_CHECKS ON CACHE BOOL "Whether to build the ConnectivityChecks plugin")
2691
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
44 SET(ENABLE_PLUGINS ON CACHE BOOL "Enable plugins")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
45 SET(UNIT_TESTS_WITH_HTTP_CONNEXIONS ON CACHE BOOL "Allow unit tests to make HTTP requests")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
46
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
47
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
48 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
49 ## Configuration of the Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
50 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
51
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
52 include(${CMAKE_SOURCE_DIR}/Resources/CMake/VisualStudioPrecompiledHeaders.cmake)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
53 include(${CMAKE_SOURCE_DIR}/Resources/CMake/OrthancFrameworkConfiguration.cmake)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
54
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
55
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
56 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
57 ## List of source files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
58 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
59
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
60 set(ORTHANC_SERVER_SOURCES
3093
2e1808b6146a reorganization of folders
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3091
diff changeset
61 OrthancServer/Database/Compatibility/DatabaseLookup.cpp
2e1808b6146a reorganization of folders
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3091
diff changeset
62 OrthancServer/Database/Compatibility/ICreateInstance.cpp
2e1808b6146a reorganization of folders
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3091
diff changeset
63 OrthancServer/Database/Compatibility/IGetChildrenMetadata.cpp
3187
4bbadcd03966 refactoring retrieval of metadata from database
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3095
diff changeset
64 OrthancServer/Database/Compatibility/ILookupResourceAndParent.cpp
3093
2e1808b6146a reorganization of folders
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3091
diff changeset
65 OrthancServer/Database/Compatibility/ILookupResources.cpp
2e1808b6146a reorganization of folders
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3091
diff changeset
66 OrthancServer/Database/Compatibility/SetOfResources.cpp
3094
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3093
diff changeset
67 OrthancServer/Database/ResourcesContent.cpp
3093
2e1808b6146a reorganization of folders
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3091
diff changeset
68 OrthancServer/Database/SQLiteDatabaseWrapper.cpp
2691
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
69 OrthancServer/DicomInstanceOrigin.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
70 OrthancServer/DicomInstanceToStore.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
71 OrthancServer/ExportedResource.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
72 OrthancServer/LuaScripting.cpp
2933
4a38d7d4f0e0 new class: OrthancConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2893
diff changeset
73 OrthancServer/OrthancConfiguration.cpp
2691
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
74 OrthancServer/OrthancFindRequestHandler.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
75 OrthancServer/OrthancHttpHandler.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
76 OrthancServer/OrthancInitialization.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
77 OrthancServer/OrthancMoveRequestHandler.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
78 OrthancServer/OrthancRestApi/OrthancRestAnonymizeModify.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
79 OrthancServer/OrthancRestApi/OrthancRestApi.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
80 OrthancServer/OrthancRestApi/OrthancRestArchive.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
81 OrthancServer/OrthancRestApi/OrthancRestChanges.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
82 OrthancServer/OrthancRestApi/OrthancRestModalities.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
83 OrthancServer/OrthancRestApi/OrthancRestResources.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
84 OrthancServer/OrthancRestApi/OrthancRestSystem.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
85 OrthancServer/QueryRetrieveHandler.cpp
3029
ea653ec47f31 new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3018
diff changeset
86 OrthancServer/Search/DatabaseConstraint.cpp
2892
ce310baccda6 DicomTagConstraint and DatabaseLookup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2867
diff changeset
87 OrthancServer/Search/DatabaseLookup.cpp
ce310baccda6 DicomTagConstraint and DatabaseLookup
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2867
diff changeset
88 OrthancServer/Search/DicomTagConstraint.cpp
2691
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
89 OrthancServer/Search/HierarchicalMatcher.cpp
3058
6faf575ba9cc refactoring: class ISqlLookupFormatter to be used in orthanc-databases
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3057
diff changeset
90 OrthancServer/Search/ISqlLookupFormatter.cpp
2691
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
91 OrthancServer/ServerContext.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
92 OrthancServer/ServerEnumerations.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
93 OrthancServer/ServerIndex.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
94 OrthancServer/ServerJobs/ArchiveJob.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
95 OrthancServer/ServerJobs/DicomModalityStoreJob.cpp
2867
251614c2edac DicomMoveScuJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2853
diff changeset
96 OrthancServer/ServerJobs/DicomMoveScuJob.cpp
2691
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
97 OrthancServer/ServerJobs/LuaJobManager.cpp
2853
52b017d22a4f New URI: "/studies/.../merge" to merge a study
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2844
diff changeset
98 OrthancServer/ServerJobs/MergeStudyJob.cpp
2691
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
99 OrthancServer/ServerJobs/Operations/DeleteResourceOperation.cpp
3095
beeeb6096f27 removing dependencies upon ServerContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3094
diff changeset
100 OrthancServer/ServerJobs/Operations/DicomInstanceOperationValue.cpp
2691
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
101 OrthancServer/ServerJobs/Operations/ModifyInstanceOperation.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
102 OrthancServer/ServerJobs/Operations/StorePeerOperation.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
103 OrthancServer/ServerJobs/Operations/StoreScuOperation.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
104 OrthancServer/ServerJobs/Operations/SystemCallOperation.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
105 OrthancServer/ServerJobs/OrthancJobUnserializer.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
106 OrthancServer/ServerJobs/OrthancPeerStoreJob.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
107 OrthancServer/ServerJobs/ResourceModificationJob.cpp
2844
99863d6245b2 New URI: "/studies/.../split" to split a study
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2808
diff changeset
108 OrthancServer/ServerJobs/SplitStudyJob.cpp
3636
bce6ee64f2a4 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3633
diff changeset
109 OrthancServer/ServerJobs/StorageCommitmentScpJob.cpp
2691
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
110 OrthancServer/ServerToolbox.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
111 OrthancServer/SliceOrdering.cpp
3736
0540b54324f1 StorageCommitmentReports
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3731
diff changeset
112 OrthancServer/StorageCommitmentReports.cpp
2691
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
113 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
114
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
115
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
116 set(ORTHANC_UNIT_TESTS_SOURCES
2893
1723cbba55c7 testing DicomTagConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2892
diff changeset
117 UnitTestsSources/DatabaseLookupTests.cpp
2691
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
118 UnitTestsSources/DicomMapTests.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
119 UnitTestsSources/FileStorageTests.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
120 UnitTestsSources/FromDcmtkTests.cpp
2893
1723cbba55c7 testing DicomTagConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2892
diff changeset
121 UnitTestsSources/ImageProcessingTests.cpp
1723cbba55c7 testing DicomTagConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2892
diff changeset
122 UnitTestsSources/ImageTests.cpp
1723cbba55c7 testing DicomTagConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2892
diff changeset
123 UnitTestsSources/JpegLosslessTests.cpp
3353
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents: 3333
diff changeset
124 UnitTestsSources/LoggingTests.cpp
2893
1723cbba55c7 testing DicomTagConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2892
diff changeset
125 UnitTestsSources/LuaTests.cpp
2691
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
126 UnitTestsSources/MemoryCacheTests.cpp
2893
1723cbba55c7 testing DicomTagConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2892
diff changeset
127 UnitTestsSources/MultiThreadingTests.cpp
2691
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
128 UnitTestsSources/RestApiTests.cpp
2893
1723cbba55c7 testing DicomTagConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2892
diff changeset
129 UnitTestsSources/SQLiteChromiumTests.cpp
2691
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
130 UnitTestsSources/SQLiteTests.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
131 UnitTestsSources/ServerIndexTests.cpp
2893
1723cbba55c7 testing DicomTagConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2892
diff changeset
132 UnitTestsSources/StreamTests.cpp
3326
b21d4cc8e5d1 speed up base64 decoding + added tests
Alain Mazy <alain@mazy.be>
parents: 3295
diff changeset
133 UnitTestsSources/ToolboxTests.cpp
2893
1723cbba55c7 testing DicomTagConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2892
diff changeset
134 UnitTestsSources/UnitTestsMain.cpp
2691
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
135 UnitTestsSources/VersionsTests.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
136 UnitTestsSources/ZipTests.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
137 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
138
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
139
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
140 if (ENABLE_PLUGINS)
3074
495c5edce708 new extension for database plugin SDK: lookupResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3071
diff changeset
141 include_directories(${CMAKE_SOURCE_DIR}/Plugins/Include)
495c5edce708 new extension for database plugin SDK: lookupResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3071
diff changeset
142
2691
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
143 list(APPEND ORTHANC_SERVER_SOURCES
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
144 Plugins/Engine/OrthancPluginDatabase.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
145 Plugins/Engine/OrthancPlugins.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
146 Plugins/Engine/PluginsEnumerations.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
147 Plugins/Engine/PluginsErrorDictionary.cpp
2808
37583cd183ed primitives to create jobs from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2773
diff changeset
148 Plugins/Engine/PluginsJob.cpp
2691
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
149 Plugins/Engine/PluginsManager.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
150 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
151
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
152 list(APPEND ORTHANC_UNIT_TESTS_SOURCES
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
153 UnitTestsSources/PluginsTests.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
154 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
155 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
156
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
157
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
158 if (CMAKE_COMPILER_IS_GNUCXX
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
159 AND NOT CMAKE_CROSSCOMPILING
3275
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3271
diff changeset
160 AND DCMTK_STATIC_VERSION STREQUAL "3.6.0")
2691
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
161 # Add the "-pedantic" flag only on the Orthanc sources, and only if
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
162 # cross-compiling DCMTK 3.6.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
163 set(ORTHANC_ALL_SOURCES
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
164 ${ORTHANC_CORE_SOURCES_INTERNAL}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
165 ${ORTHANC_DICOM_SOURCES_INTERNAL}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
166 ${ORTHANC_SERVER_SOURCES}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
167 ${ORTHANC_UNIT_TESTS_SOURCES}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
168 Plugins/Samples/ServeFolders/Plugin.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
169 Plugins/Samples/ModalityWorklists/Plugin.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
170 OrthancServer/main.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
171 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
172
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
173 set_source_files_properties(${ORTHANC_ALL_SOURCES}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
174 PROPERTIES COMPILE_FLAGS -pedantic
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
175 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
176 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
177
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
178
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
179 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
180 ## Autogeneration of files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
181 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
182
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
183 set(ORTHANC_EMBEDDED_FILES
3094
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3093
diff changeset
184 CONFIGURATION_SAMPLE ${CMAKE_CURRENT_SOURCE_DIR}/Resources/Configuration.json
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3093
diff changeset
185 DICOM_CONFORMANCE_STATEMENT ${CMAKE_CURRENT_SOURCE_DIR}/Resources/DicomConformanceStatement.txt
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3093
diff changeset
186 FONT_UBUNTU_MONO_BOLD_16 ${CMAKE_CURRENT_SOURCE_DIR}/Resources/Fonts/UbuntuMonoBold-16.json
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3093
diff changeset
187 LUA_TOOLBOX ${CMAKE_CURRENT_SOURCE_DIR}/Resources/Toolbox.lua
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3093
diff changeset
188 PREPARE_DATABASE ${CMAKE_CURRENT_SOURCE_DIR}/OrthancServer/Database/PrepareDatabase.sql
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3093
diff changeset
189 UPGRADE_DATABASE_3_TO_4 ${CMAKE_CURRENT_SOURCE_DIR}/OrthancServer/Database/Upgrade3To4.sql
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3093
diff changeset
190 UPGRADE_DATABASE_4_TO_5 ${CMAKE_CURRENT_SOURCE_DIR}/OrthancServer/Database/Upgrade4To5.sql
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3093
diff changeset
191
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3093
diff changeset
192 INSTALL_TRACK_ATTACHMENTS_SIZE
61da3c9b4121 cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3093
diff changeset
193 ${CMAKE_CURRENT_SOURCE_DIR}/OrthancServer/Database/InstallTrackAttachmentsSize.sql
2691
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
194 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
195
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
196 if (STANDALONE_BUILD)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
197 # We embed all the resources in the binaries for standalone builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
198 add_definitions(-DORTHANC_STANDALONE=1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
199 EmbedResources(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
200 ${ORTHANC_EMBEDDED_FILES}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
201 ORTHANC_EXPLORER ${CMAKE_CURRENT_SOURCE_DIR}/OrthancExplorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
202 ${DCMTK_DICTIONARIES}
3333
2a38e00a0638 Size of the Orthanc static binaries are reduced by compressing ICU data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3326
diff changeset
203 ${LIBICU_RESOURCES}
2691
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
204 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
205 else()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
206 add_definitions(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
207 -DORTHANC_STANDALONE=0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
208 -DORTHANC_PATH=\"${CMAKE_SOURCE_DIR}\"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
209 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
210 EmbedResources(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
211 ${ORTHANC_EMBEDDED_FILES}
3333
2a38e00a0638 Size of the Orthanc static binaries are reduced by compressing ICU data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3326
diff changeset
212 ${LIBICU_RESOURCES}
2691
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
213 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
214 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
215
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
216 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
217 execute_process(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
218 COMMAND
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
219 ${PYTHON_EXECUTABLE} ${ORTHANC_ROOT}/Resources/WindowsResources.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
220 ${ORTHANC_VERSION} Orthanc Orthanc.exe "Lightweight, RESTful DICOM server for medical imaging"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
221 ERROR_VARIABLE Failure
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
222 OUTPUT_FILE ${AUTOGENERATED_DIR}/Orthanc.rc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
223 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
224
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
225 if (Failure)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
226 message(FATAL_ERROR "Error while computing the version information: ${Failure}")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
227 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
228
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
229 list(APPEND ORTHANC_RESOURCES ${AUTOGENERATED_DIR}/Orthanc.rc)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
230 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
231
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
232
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
233
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
234 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
235 ## Configuration of the C/C++ macros
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
236 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
237
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
238 if (ENABLE_PLUGINS)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
239 add_definitions(-DORTHANC_ENABLE_PLUGINS=1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
240 else()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
241 add_definitions(-DORTHANC_ENABLE_PLUGINS=0)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
242 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
243
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
244
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
245 if (UNIT_TESTS_WITH_HTTP_CONNEXIONS)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
246 add_definitions(-DUNIT_TESTS_WITH_HTTP_CONNEXIONS=1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
247 else()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
248 add_definitions(-DUNIT_TESTS_WITH_HTTP_CONNEXIONS=0)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
249 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
250
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
251
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
252 add_definitions(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
253 -DORTHANC_BUILD_UNIT_TESTS=1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
254 -DORTHANC_ENABLE_LOGGING_PLUGIN=0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
255
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
256 # Macros for the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
257 -DHAS_ORTHANC_EXCEPTION=0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
258 -DMODALITY_WORKLISTS_VERSION="${ORTHANC_VERSION}"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
259 -DSERVE_FOLDERS_VERSION="${ORTHANC_VERSION}"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
260 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
261
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
262
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
263 # Setup precompiled headers for Microsoft Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
264
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
265 # WARNING: There must be NO MORE "add_definitions()", "include()" or
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
266 # "include_directories()" below, otherwise the generated precompiled
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
267 # headers might get broken!
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
268
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
269 if (MSVC)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
270 add_definitions(-DORTHANC_USE_PRECOMPILED_HEADERS=1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
271
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
272 set(TMP
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
273 ${ORTHANC_CORE_SOURCES_INTERNAL}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
274 ${ORTHANC_DICOM_SOURCES_INTERNAL}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
275 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
276
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
277 ADD_VISUAL_STUDIO_PRECOMPILED_HEADERS(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
278 "PrecompiledHeaders.h" "Core/PrecompiledHeaders.cpp"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
279 TMP ORTHANC_CORE_PCH)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
280
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
281 ADD_VISUAL_STUDIO_PRECOMPILED_HEADERS(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
282 "PrecompiledHeadersServer.h" "OrthancServer/PrecompiledHeadersServer.cpp"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
283 ORTHANC_SERVER_SOURCES ORTHANC_SERVER_PCH)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
284
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
285 ADD_VISUAL_STUDIO_PRECOMPILED_HEADERS(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
286 "PrecompiledHeadersUnitTests.h" "UnitTestsSources/PrecompiledHeadersUnitTests.cpp"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
287 ORTHANC_UNIT_TESTS_SOURCES ORTHANC_UNIT_TESTS_PCH)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
288 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
289
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
290
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
291
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
292 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
293 ## Build the core of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
294 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
295
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
296 # "CoreLibrary" contains all the third-party dependencies and the
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
297 # content of the "Core" folder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
298 add_library(CoreLibrary
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
299 STATIC
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
300 ${ORTHANC_CORE_PCH}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
301 ${ORTHANC_CORE_SOURCES}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
302 ${ORTHANC_DICOM_SOURCES}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
303 ${AUTOGENERATED_SOURCES}
3270
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3233
diff changeset
304 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3233
diff changeset
305
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3233
diff changeset
306 if (LIBICU_LIBRARIES)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3233
diff changeset
307 target_link_libraries(CoreLibrary ${LIBICU_LIBRARIES})
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3233
diff changeset
308 endif()
2691
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
309
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
310
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
311 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
312 ## Build the Orthanc server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
313 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
314
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
315 add_library(ServerLibrary
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
316 STATIC
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
317 ${ORTHANC_SERVER_PCH}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
318 ${ORTHANC_SERVER_SOURCES}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
319 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
320
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
321 # Ensure autogenerated code is built before building ServerLibrary
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
322 add_dependencies(ServerLibrary CoreLibrary)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
323
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
324 add_executable(Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
325 OrthancServer/main.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
326 ${ORTHANC_RESOURCES}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
327 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
328
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
329 target_link_libraries(Orthanc ServerLibrary CoreLibrary ${DCMTK_LIBRARIES})
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
330
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
331 install(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
332 TARGETS Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
333 RUNTIME DESTINATION sbin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
334 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
335
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
336
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
337 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
338 ## Build the unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
339 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
340
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
341 add_executable(UnitTests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
342 ${GOOGLE_TEST_SOURCES}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
343 ${ORTHANC_UNIT_TESTS_PCH}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
344 ${ORTHANC_UNIT_TESTS_SOURCES}
3326
b21d4cc8e5d1 speed up base64 decoding + added tests
Alain Mazy <alain@mazy.be>
parents: 3295
diff changeset
345 ${BOOST_EXTENDED_SOURCES}
2691
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
346 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
347
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
348 target_link_libraries(UnitTests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
349 ServerLibrary
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
350 CoreLibrary
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
351 ${DCMTK_LIBRARIES}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
352 ${GOOGLE_TEST_LIBRARIES}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
353 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
354
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
355
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
356 #####################################################################
3233
47fbb0467a62 Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3187
diff changeset
357 ## Build a static library to share code between the plugins
47fbb0467a62 Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3187
diff changeset
358 #####################################################################
47fbb0467a62 Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3187
diff changeset
359
47fbb0467a62 Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3187
diff changeset
360 if (ENABLE_PLUGINS AND
47fbb0467a62 Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3187
diff changeset
361 (BUILD_SERVE_FOLDERS OR BUILD_MODALITY_WORKLISTS))
47fbb0467a62 Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3187
diff changeset
362 add_library(ThirdPartyPlugins STATIC
47fbb0467a62 Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3187
diff changeset
363 ${BOOST_SOURCES}
47fbb0467a62 Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3187
diff changeset
364 ${JSONCPP_SOURCES}
47fbb0467a62 Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3187
diff changeset
365 ${LIBICONV_SOURCES}
47fbb0467a62 Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3187
diff changeset
366 ${LIBICU_SOURCES}
47fbb0467a62 Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3187
diff changeset
367 Plugins/Samples/Common/OrthancPluginCppWrapper.cpp
47fbb0467a62 Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3187
diff changeset
368 )
47fbb0467a62 Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3187
diff changeset
369
3271
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3270
diff changeset
370 if (LIBICU_LIBRARIES)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3270
diff changeset
371 target_link_libraries(ThirdPartyPlugins ${LIBICU_LIBRARIES})
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3270
diff changeset
372 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3270
diff changeset
373
3233
47fbb0467a62 Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3187
diff changeset
374 # Add the "-fPIC" option as this static library must be embedded
47fbb0467a62 Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3187
diff changeset
375 # inside shared libraries (important on UNIX)
47fbb0467a62 Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3187
diff changeset
376 set_property(
47fbb0467a62 Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3187
diff changeset
377 TARGET ThirdPartyPlugins
47fbb0467a62 Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3187
diff changeset
378 PROPERTY POSITION_INDEPENDENT_CODE ON
47fbb0467a62 Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3187
diff changeset
379 )
47fbb0467a62 Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3187
diff changeset
380 endif()
47fbb0467a62 Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3187
diff changeset
381
47fbb0467a62 Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3187
diff changeset
382
47fbb0467a62 Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3187
diff changeset
383 #####################################################################
2691
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
384 ## Build the "ServeFolders" plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
385 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
386
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
387 if (ENABLE_PLUGINS AND BUILD_SERVE_FOLDERS)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
388 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
389 execute_process(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
390 COMMAND
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
391 ${PYTHON_EXECUTABLE} ${ORTHANC_ROOT}/Resources/WindowsResources.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
392 ${ORTHANC_VERSION} ServeFolders ServeFolders.dll "Orthanc plugin to serve additional folders"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
393 ERROR_VARIABLE Failure
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
394 OUTPUT_FILE ${AUTOGENERATED_DIR}/ServeFolders.rc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
395 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
396
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
397 if (Failure)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
398 message(FATAL_ERROR "Error while computing the version information: ${Failure}")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
399 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
400
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
401 list(APPEND SERVE_FOLDERS_RESOURCES ${AUTOGENERATED_DIR}/ServeFolders.rc)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
402 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
403
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
404 add_library(ServeFolders SHARED
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
405 Plugins/Samples/ServeFolders/Plugin.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
406 ${SERVE_FOLDERS_RESOURCES}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
407 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
408
3233
47fbb0467a62 Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3187
diff changeset
409 target_link_libraries(ServeFolders ThirdPartyPlugins)
47fbb0467a62 Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3187
diff changeset
410
2691
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
411 set_target_properties(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
412 ServeFolders PROPERTIES
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
413 VERSION ${ORTHANC_VERSION}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
414 SOVERSION ${ORTHANC_VERSION}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
415 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
416
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
417 install(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
418 TARGETS ServeFolders
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
419 RUNTIME DESTINATION lib # Destination for Windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
420 LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
421 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
422 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
423
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
424
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
425
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
426 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
427 ## Build the "ModalityWorklists" plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
428 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
429
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
430 if (ENABLE_PLUGINS AND BUILD_MODALITY_WORKLISTS)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
431 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
432 execute_process(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
433 COMMAND
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
434 ${PYTHON_EXECUTABLE} ${ORTHANC_ROOT}/Resources/WindowsResources.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
435 ${ORTHANC_VERSION} ModalityWorklists ModalityWorklists.dll "Sample Orthanc plugin to serve modality worklists"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
436 ERROR_VARIABLE Failure
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
437 OUTPUT_FILE ${AUTOGENERATED_DIR}/ModalityWorklists.rc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
438 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
439
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
440 if (Failure)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
441 message(FATAL_ERROR "Error while computing the version information: ${Failure}")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
442 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
443
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
444 list(APPEND MODALITY_WORKLISTS_RESOURCES ${AUTOGENERATED_DIR}/ModalityWorklists.rc)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
445 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
446
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
447 add_library(ModalityWorklists SHARED
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
448 Plugins/Samples/ModalityWorklists/Plugin.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
449 ${MODALITY_WORKLISTS_RESOURCES}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
450 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
451
3233
47fbb0467a62 Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3187
diff changeset
452 target_link_libraries(ModalityWorklists ThirdPartyPlugins)
47fbb0467a62 Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3187
diff changeset
453
2691
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
454 set_target_properties(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
455 ModalityWorklists PROPERTIES
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
456 VERSION ${ORTHANC_VERSION}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
457 SOVERSION ${ORTHANC_VERSION}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
458 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
459
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
460 install(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
461 TARGETS ModalityWorklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
462 RUNTIME DESTINATION lib # Destination for Windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
463 LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
464 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
465 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
466
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
467
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
468
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
469 #####################################################################
3622
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
470 ## Build the "ConnectivityChecks" plugin
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
471 #####################################################################
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
472
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
473 if (ENABLE_PLUGINS AND BUILD_CONNECTIVITY_CHECKS)
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
474 include(ExternalProject)
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
475
3625
d5cf43519a49 fix lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3624
diff changeset
476 set(Flags)
3627
b03854e0f796 trying to fix output folders for OS X and windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3626
diff changeset
477
3622
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
478 if (CMAKE_TOOLCHAIN_FILE)
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
479 # Take absolute path to the toolchain
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
480 get_filename_component(TMP ${CMAKE_TOOLCHAIN_FILE} REALPATH BASE ${CMAKE_SOURCE_DIR})
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
481 list(APPEND Flags -DCMAKE_TOOLCHAIN_FILE=${TMP})
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
482 endif()
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
483
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
484 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase")
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
485 list(APPEND Flags
3625
d5cf43519a49 fix lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3624
diff changeset
486 -DLSB_CC=${CMAKE_LSB_CC}
d5cf43519a49 fix lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3624
diff changeset
487 -DLSB_CXX=${CMAKE_LSB_CXX}
3622
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
488 )
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
489 endif()
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
490
3637
06eb59faf4da use a shorter path for VS2008
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3636
diff changeset
491 externalproject_add(ConnectivityChecks
3622
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
492 SOURCE_DIR "${ORTHANC_ROOT}/Plugins/Samples/ConnectivityChecks"
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
493
3637
06eb59faf4da use a shorter path for VS2008
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3636
diff changeset
494 # We explicitly provide a build directory, in order to avoid paths
06eb59faf4da use a shorter path for VS2008
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3636
diff changeset
495 # that are too long on our Visual Studio 2008 CIS
06eb59faf4da use a shorter path for VS2008
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3636
diff changeset
496 BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/ConnectivityChecks-build"
06eb59faf4da use a shorter path for VS2008
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3636
diff changeset
497
3622
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
498 CMAKE_ARGS
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
499 -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
3623
a6bfa09df8b3 fix for cis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3622
diff changeset
500 -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}
3622
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
501 -DPLUGIN_VERSION=${ORTHANC_VERSION}
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
502 -DSTATIC_BUILD=${STATIC_BUILD}
3625
d5cf43519a49 fix lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3624
diff changeset
503 -DALLOW_DOWNLOADS=${ALLOW_DOWNLOADS}
3622
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
504 -DUSE_LEGACY_JSONCPP=${USE_LEGACY_JSONCPP}
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
505 ${Flags}
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
506 )
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
507
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
508 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
509 if (MSVC)
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
510 set(Prefix "")
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
511 else()
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
512 set(Prefix "lib") # MinGW
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
513 endif()
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
514
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
515 install(FILES
3633
5295a49dd78a removing not working tricks for ConnectivityChecks plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3628
diff changeset
516 ${CMAKE_CURRENT_BINARY_DIR}/${Prefix}ConnectivityChecks.dll
3622
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
517 DESTINATION "lib")
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
518 else()
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
519 list(GET CMAKE_FIND_LIBRARY_PREFIXES 0 Prefix)
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
520 list(GET CMAKE_FIND_LIBRARY_SUFFIXES 0 Suffix)
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
521 install(FILES
3633
5295a49dd78a removing not working tricks for ConnectivityChecks plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3628
diff changeset
522 ${CMAKE_CURRENT_BINARY_DIR}/${Prefix}ConnectivityChecks${Suffix}
5295a49dd78a removing not working tricks for ConnectivityChecks plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3628
diff changeset
523 ${CMAKE_CURRENT_BINARY_DIR}/${Prefix}ConnectivityChecks${Suffix}.${ORTHANC_VERSION}
3622
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
524 DESTINATION "share/orthanc/plugins")
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
525 endif()
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
526 endif()
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
527
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
528
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
529
8afc14fab01f New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3353
diff changeset
530 #####################################################################
2691
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
531 ## Build the companion tool to recover files compressed using Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
532 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
533
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
534 if (BUILD_RECOVER_COMPRESSED_FILE)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
535 set(RECOVER_COMPRESSED_SOURCES
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
536 Resources/Samples/Tools/RecoverCompressedFile.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
537 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
538
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
539 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
540 execute_process(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
541 COMMAND
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
542 ${PYTHON_EXECUTABLE} ${ORTHANC_ROOT}/Resources/WindowsResources.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
543 ${ORTHANC_VERSION} OrthancRecoverCompressedFile OrthancRecoverCompressedFile.exe
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
544 "Lightweight, RESTful DICOM server for medical imaging"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
545 ERROR_VARIABLE Failure
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
546 OUTPUT_FILE ${AUTOGENERATED_DIR}/OrthancRecoverCompressedFile.rc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
547 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
548
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
549 if (Failure)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
550 message(FATAL_ERROR "Error while computing the version information: ${Failure}")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
551 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
552
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
553 list(APPEND RECOVER_COMPRESSED_SOURCES
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
554 ${AUTOGENERATED_DIR}/OrthancRecoverCompressedFile.rc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
555 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
556 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
557
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
558 add_executable(OrthancRecoverCompressedFile ${RECOVER_COMPRESSED_SOURCES})
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
559
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
560 target_link_libraries(OrthancRecoverCompressedFile CoreLibrary)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
561
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
562 install(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
563 TARGETS OrthancRecoverCompressedFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
564 RUNTIME DESTINATION bin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
565 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
566 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
567
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
568
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
569
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
570 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
571 ## Generate the documentation if Doxygen is present
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
572 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
573
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
574 find_package(Doxygen)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
575 if (DOXYGEN_FOUND)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
576 configure_file(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
577 ${CMAKE_SOURCE_DIR}/Resources/Orthanc.doxygen
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
578 ${CMAKE_CURRENT_BINARY_DIR}/Orthanc.doxygen
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
579 @ONLY)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
580
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
581 configure_file(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
582 ${CMAKE_SOURCE_DIR}/Resources/OrthancPlugin.doxygen
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
583 ${CMAKE_CURRENT_BINARY_DIR}/OrthancPlugin.doxygen
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
584 @ONLY)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
585
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
586 add_custom_target(doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
587 ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Orthanc.doxygen
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
588 COMMENT "Generating internal documentation with Doxygen" VERBATIM
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
589 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
590
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
591 add_custom_command(TARGET Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
592 POST_BUILD
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
593 COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/OrthancPlugin.doxygen
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
594 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
595 COMMENT "Generating plugin documentation with Doxygen" VERBATIM
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
596 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
597
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
598 install(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
599 DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/OrthancPluginDocumentation/doc/
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
600 DESTINATION share/doc/orthanc/OrthancPlugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
601 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
602 else()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
603 message("Doxygen not found. The documentation will not be built.")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
604 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
605
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
606
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
607
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
608 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
609 ## Install the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
610 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
611
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
612 if (ENABLE_PLUGINS)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
613 install(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
614 FILES
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
615 Plugins/Include/orthanc/OrthancCPlugin.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
616 Plugins/Include/orthanc/OrthancCDatabasePlugin.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
617 DESTINATION include/orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
618 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
619 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
620
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
621
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
622
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
623 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
624 ## Prepare the "uninstall" target
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
625 ## http://www.cmake.org/Wiki/CMake_FAQ#Can_I_do_.22make_uninstall.22_with_CMake.3F
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
626 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
627
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
628 configure_file(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
629 "${CMAKE_CURRENT_SOURCE_DIR}/Resources/CMake/Uninstall.cmake.in"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
630 "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
631 IMMEDIATE @ONLY)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
632
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
633 add_custom_target(uninstall
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
634 COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)