annotate CMakeLists.txt @ 17:ae34bde412ae default tip

note
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 21 Dec 2016 11:05:16 +0100
parents f7379096e014
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 # TODO !
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 cmake_minimum_required(VERSION 2.8)
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 project(OrthancClient)
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6
3
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
7
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
8 # Parameters of the build
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
9 SET(STATIC_BUILD OFF CACHE BOOL "Static build of the third-party libraries (necessary for Windows)")
9
1fb480a156fd build unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
10 SET(ALLOW_DOWNLOADS OFF CACHE BOOL "Allow CMake to download packages")
3
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
11
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
12 # Advanced parameters to fine-tune linking against system libraries
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
13 SET(USE_SYSTEM_BOOST ON CACHE BOOL "Use the system version of Boost")
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
14 SET(USE_SYSTEM_CURL ON CACHE BOOL "Use the system version of LibCurl")
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
15 SET(USE_SYSTEM_GOOGLE_TEST ON CACHE BOOL "Use the system version of Google Test")
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
16 SET(USE_SYSTEM_JSONCPP ON CACHE BOOL "Use the system version of JsonCpp")
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
17 SET(USE_SYSTEM_LIBPNG ON CACHE BOOL "Use the system version of LibPng")
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
18 SET(USE_SYSTEM_OPENSSL ON CACHE BOOL "Use the system version of OpenSSL")
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
19 SET(USE_SYSTEM_ZLIB ON CACHE BOOL "Use the system version of ZLib")
1
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20
3
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
21 # Some basic inclusions
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
22 SET(ORTHANC_ROOT ${CMAKE_SOURCE_DIR}/Orthanc)
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
23 SET(ENABLE_SSL ON)
14
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 9
diff changeset
24 SET(ENABLE_PLUGINS_VERSION_SCRIPT OFF)
1
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25
3
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
26 include(CheckIncludeFiles)
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
27 include(CheckIncludeFileCXX)
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
28 include(CheckLibraryExists)
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
29 include(FindPythonInterp)
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
30 include(Orthanc/Resources/CMake/DownloadPackage.cmake)
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
31 include(Orthanc/Resources/CMake/Compiler.cmake)
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
32
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
33 include(Orthanc/Resources/CMake/BoostConfiguration.cmake)
9
1fb480a156fd build unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
34 include(Orthanc/Resources/CMake/GoogleTestConfiguration.cmake)
3
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
35 include(Orthanc/Resources/CMake/JsonCppConfiguration.cmake)
9
1fb480a156fd build unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
36 include(Orthanc/Resources/CMake/LibCurlConfiguration.cmake)
3
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
37 include(Orthanc/Resources/CMake/LibPngConfiguration.cmake)
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
38 include(Orthanc/Resources/CMake/OpenSslConfiguration.cmake)
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
39 include(Orthanc/Resources/CMake/ZlibConfiguration.cmake)
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
40
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
41 add_definitions(-DORTHANC_SSL_ENABLED=1)
1
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 #####################################################################
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 ## Create the standalone DLL containing the Orthanc Client API
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 #####################################################################
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47
6
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
48 include_directories(Resources/Laaw)
1
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 if (CMAKE_CROSSCOMPILING)
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 # Remove the default "lib" prefix from "libOrthancClient.dll" if cross-compiling
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 set(CMAKE_SHARED_LIBRARY_PREFIX "")
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 if (${CMAKE_SIZEOF_VOID_P} EQUAL 4)
9
1fb480a156fd build unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
56 set(ORTHANC_CPP_CLIENT_AUX SharedLibrary/AUTOGENERATED/Windows32.def)
1
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 elseif (${CMAKE_SIZEOF_VOID_P} EQUAL 8)
9
1fb480a156fd build unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
58 set(ORTHANC_CPP_CLIENT_AUX SharedLibrary/AUTOGENERATED/Windows64.def)
1
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 else()
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 message(FATAL_ERROR "Support your platform here")
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 endif()
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 else()
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 # Nothing to do if using Visual Studio
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 endif()
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 if (${CMAKE_SIZEOF_VOID_P} EQUAL 4)
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 set(CMAKE_SHARED_LIBRARY_SUFFIX "_Windows32.dll")
9
1fb480a156fd build unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
68 list(APPEND ORTHANC_CPP_CLIENT_AUX SharedLibrary/AUTOGENERATED/Windows32.rc)
1
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 elseif (${CMAKE_SIZEOF_VOID_P} EQUAL 8)
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 set(CMAKE_SHARED_LIBRARY_SUFFIX "_Windows64.dll")
9
1fb480a156fd build unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
71 list(APPEND ORTHANC_CPP_CLIENT_AUX SharedLibrary/AUTOGENERATED/Windows64.rc)
1
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 else()
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 message(FATAL_ERROR "Support your platform here")
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 endif()
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 else()
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 set(ORTHANC_CPP_CLIENT_AUX ${OPENSSL_SOURCES})
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 endif()
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79
14
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 9
diff changeset
80 add_definitions(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 9
diff changeset
81 -DORTHANC_ENABLE_MD5=0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 9
diff changeset
82 -DORTHANC_ENABLE_BASE64=0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 9
diff changeset
83 -DORTHANC_ENABLE_LOGGING=0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 9
diff changeset
84 )
3
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
85
1
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 add_library(OrthancClient SHARED
14
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 9
diff changeset
87 Orthanc/Core/ChunkedBuffer.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 9
diff changeset
88 Orthanc/Core/Enumerations.cpp
3
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
89 Orthanc/Core/HttpClient.cpp
14
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 9
diff changeset
90 Orthanc/Core/Images/ImageAccessor.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 9
diff changeset
91 Orthanc/Core/Images/PngReader.cpp
3
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
92 Orthanc/Core/MultiThreading/SharedMessageQueue.cpp
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
93 Orthanc/Core/Toolbox.cpp
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
94
6
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
95 CppClient/Instance.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
96 CppClient/OrthancConnection.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
97 CppClient/Patient.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
98 CppClient/Series.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
99 CppClient/Study.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
100 CppClient/ArrayFilledByThreads.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
101 CppClient/ThreadedCommandProcessor.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
102
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
103 SharedLibrary/SharedLibrary.cpp
3
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
104
1
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105 ${ORTHANC_CPP_CLIENT_AUX}
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
106 ${THIRD_PARTY_SOURCES}
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107 ${CURL_SOURCES}
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108 )
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109
3
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
110
9
1fb480a156fd build unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
111 add_executable(UnitTests
1fb480a156fd build unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
112 CppClient/ArrayFilledByThreads.cpp
1fb480a156fd build unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
113 CppClient/ThreadedCommandProcessor.cpp
14
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 9
diff changeset
114 Orthanc/Core/Enumerations.cpp
9
1fb480a156fd build unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
115 Orthanc/Core/MultiThreading/SharedMessageQueue.cpp
14
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 9
diff changeset
116 Orthanc/Core/Toolbox.cpp
9
1fb480a156fd build unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
117 UnitTestsSources/MultiThreadingTests.cpp
1fb480a156fd build unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
118 UnitTestsSources/UnitTestsMain.cpp
1fb480a156fd build unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
119
1fb480a156fd build unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
120 ${THIRD_PARTY_SOURCES}
1fb480a156fd build unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
121 ${GTEST_SOURCES}
1fb480a156fd build unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
122 )
1fb480a156fd build unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
123
1fb480a156fd build unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
124
3
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
125 list(LENGTH OPENSSL_SOURCES OPENSSL_SOURCES_LENGTH)
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
126 if (${OPENSSL_SOURCES_LENGTH} GREATER 0)
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
127 add_library(OpenSSL STATIC ${OPENSSL_SOURCES})
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
128 target_link_libraries(OrthancClient OpenSSL)
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
129 endif()
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
130
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
131
1
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133 ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD" OR
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134 ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135 set_target_properties(OrthancClient
6
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
136 PROPERTIES LINK_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined -Wl,--as-needed -Wl,--version-script=${CMAKE_SOURCE_DIR}/Resources/Laaw/VersionScript.map"
1
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137 )
8
6d59828e2662 removal of Orthanc namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 6
diff changeset
138 target_link_libraries(OrthancClient pthread dl)
1
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
3
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
141 target_link_libraries(OrthancClient ws2_32)
1
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143 if (CMAKE_CROSSCOMPILING)
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144 set_target_properties(OrthancClient
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145 PROPERTIES LINK_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--allow-multiple-definition -static-libgcc -static-libstdc++"
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146 )
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147 endif()
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150 # TODO
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151 target_link_libraries(OrthancClient pthread)
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153 else()
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154 message(FATAL_ERROR "Support your platform here")
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155 endif()
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158 # Set the version of the "Orthanc Client" shared library
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 file(STRINGS
6
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
160 ${CMAKE_SOURCE_DIR}/SharedLibrary/Product.json
1
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161 ORTHANC_CLIENT_VERSION_TMP
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
162 REGEX "^[ \t]*\"Version\"[ \t]*")
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164 string(REGEX REPLACE "^.*\"([0-9]+)\\.([0-9]+)\\.([0-9]+)\"" "\\1.\\2"
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165 ORTHANC_CLIENT_VERSION ${ORTHANC_CLIENT_VERSION_TMP})
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
166
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
167 message("Setting the version of the library to ${ORTHANC_CLIENT_VERSION}")
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
168
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
169 set_target_properties(OrthancClient PROPERTIES
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
170 VERSION ${ORTHANC_CLIENT_VERSION}
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
171 SOVERSION ${ORTHANC_CLIENT_VERSION})
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
172
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
173
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
174 install(
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
175 TARGETS OrthancClient
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
176 RUNTIME DESTINATION lib # Destination for Windows
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
177 LIBRARY DESTINATION lib # Destination for Linux
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
178 )
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
179
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
180 install(
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
181 FILES
9
1fb480a156fd build unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
182 SharedLibrary/AUTOGENERATED/CppClient.h
1
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
183 DESTINATION include/orthanc
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
184 )
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
185
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
186
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
187
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
188
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
189 #####################################################################
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
190 ## Generate the documentation if Doxygen is present
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
191 #####################################################################
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
192
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
193 find_package(Doxygen)
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
194 if (DOXYGEN_FOUND)
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
195 configure_file(
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
196 ${CMAKE_SOURCE_DIR}/Resources/OrthancClient.doxygen
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
197 ${CMAKE_CURRENT_BINARY_DIR}/OrthancClient.doxygen
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
198 @ONLY)
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
199
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
200 add_custom_command(TARGET OrthancClient
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
201 POST_BUILD
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
202 COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/OrthancClient.doxygen
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
203 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
204 COMMENT "Generating client documentation with Doxygen" VERBATIM
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
205 )
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
206
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
207 install(
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
208 DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/OrthancClientDocumentation/doc/
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
209 DESTINATION share/doc/orthanc/OrthancClient
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
210 )
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
211
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
212 else()
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
213 message("Doxygen not found. The documentation will not be built.")
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
214 endif()
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
215
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
216
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
217 #####################################################################
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
218 ## Prepare the "uninstall" target
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
219 ## http://www.cmake.org/Wiki/CMake_FAQ#Can_I_do_.22make_uninstall.22_with_CMake.3F
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
220 #####################################################################
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
221
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
222 configure_file(
3
d5027f9f676a fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
223 "${CMAKE_CURRENT_SOURCE_DIR}/Orthanc/Resources/CMake/Uninstall.cmake.in"
1
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
224 "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
225 IMMEDIATE @ONLY)
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
226
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
227 add_custom_target(uninstall
fd402e53d263 new files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
228 COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)