Mercurial > hg > orthanc
annotate Resources/Archives/OrthancCppClient.cmake @ 2746:571e0058d2b3 Orthanc-0.6.2
close old branch
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 17 Jul 2018 09:39:26 +0200 |
parents | 31f1b7d5d7d2 |
children |
rev | line source |
---|---|
512
1b8a1c43893e
compilation of the dll 32/64
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
510
diff
changeset
|
1 include_directories(${ORTHANC_ROOT}/OrthancCppClient/Package/Laaw) |
506 | 2 |
3 set(STATIC_BUILD ON) | |
4 include(${ORTHANC_ROOT}/Resources/CMake/DownloadPackage.cmake) | |
5 include(${ORTHANC_ROOT}/Resources/CMake/JsonCppConfiguration.cmake) | |
6 include(${ORTHANC_ROOT}/Resources/CMake/LibCurlConfiguration.cmake) | |
7 include(${ORTHANC_ROOT}/Resources/CMake/LibPngConfiguration.cmake) | |
8 include(${ORTHANC_ROOT}/Resources/CMake/BoostConfiguration.cmake) | |
9 include(${ORTHANC_ROOT}/Resources/CMake/ZlibConfiguration.cmake) | |
10 | |
11 if (${CMAKE_COMPILER_IS_GNUCXX}) | |
12 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -pedantic -Wno-implicit-function-declaration") # --std=c99 makes libcurl not to compile | |
13 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Wno-long-long -Wno-variadic-macros") | |
14 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed") | |
15 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined") | |
16 elseif (${MSVC}) | |
17 add_definitions(-D_CRT_SECURE_NO_WARNINGS=1) | |
18 endif() | |
19 | |
512
1b8a1c43893e
compilation of the dll 32/64
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
510
diff
changeset
|
20 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") |
1b8a1c43893e
compilation of the dll 32/64
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
510
diff
changeset
|
21 if (${CMAKE_SIZEOF_VOID_P} EQUAL 4) |
1b8a1c43893e
compilation of the dll 32/64
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
510
diff
changeset
|
22 set(WINDOWS_DEF ${ORTHANC_ROOT}/OrthancCppClient/Package/Build/Windows32.def) |
1b8a1c43893e
compilation of the dll 32/64
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
510
diff
changeset
|
23 elseif (${CMAKE_SIZEOF_VOID_P} EQUAL 8) |
1b8a1c43893e
compilation of the dll 32/64
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
510
diff
changeset
|
24 set(WINDOWS_DEF ${ORTHANC_ROOT}/OrthancCppClient/Package/Build/Windows64.def) |
1b8a1c43893e
compilation of the dll 32/64
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
510
diff
changeset
|
25 else() |
1b8a1c43893e
compilation of the dll 32/64
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
510
diff
changeset
|
26 message(FATAL_ERROR "Support your platform here") |
1b8a1c43893e
compilation of the dll 32/64
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
510
diff
changeset
|
27 endif() |
1b8a1c43893e
compilation of the dll 32/64
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
510
diff
changeset
|
28 endif() |
1b8a1c43893e
compilation of the dll 32/64
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
510
diff
changeset
|
29 |
506 | 30 add_library(OrthancCppClient SHARED |
31 ${THIRD_PARTY_SOURCES} | |
32 ${ORTHANC_ROOT}/Core/OrthancException.cpp | |
33 ${ORTHANC_ROOT}/Core/Enumerations.cpp | |
34 ${ORTHANC_ROOT}/Core/Toolbox.cpp | |
35 ${ORTHANC_ROOT}/Core/HttpClient.cpp | |
36 ${ORTHANC_ROOT}/Core/MultiThreading/ArrayFilledByThreads.cpp | |
37 ${ORTHANC_ROOT}/Core/MultiThreading/ThreadedCommandProcessor.cpp | |
38 ${ORTHANC_ROOT}/Core/MultiThreading/SharedMessageQueue.cpp | |
39 ${ORTHANC_ROOT}/Core/FileFormats/PngReader.cpp | |
40 ${ORTHANC_ROOT}/OrthancCppClient/OrthancConnection.cpp | |
41 ${ORTHANC_ROOT}/OrthancCppClient/Series.cpp | |
42 ${ORTHANC_ROOT}/OrthancCppClient/Study.cpp | |
43 ${ORTHANC_ROOT}/OrthancCppClient/Instance.cpp | |
44 ${ORTHANC_ROOT}/OrthancCppClient/Patient.cpp | |
512
1b8a1c43893e
compilation of the dll 32/64
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
510
diff
changeset
|
45 ${ORTHANC_ROOT}/OrthancCppClient/Package/SharedLibrary.cpp |
506 | 46 ${ORTHANC_ROOT}/Resources/sha1/sha1.cpp |
47 ${ORTHANC_ROOT}/Resources/md5/md5.c | |
48 ${ORTHANC_ROOT}/Resources/base64/base64.cpp | |
512
1b8a1c43893e
compilation of the dll 32/64
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
510
diff
changeset
|
49 ${WINDOWS_DEF} |
506 | 50 ) |
51 | |
52 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") | |
516
49a1228d6fe7
building the dll from the main CMakeLists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
514
diff
changeset
|
53 set_target_properties(OrthancCppClient |
49a1228d6fe7
building the dll from the main CMakeLists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
514
diff
changeset
|
54 PROPERTIES LINK_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined -Wl,--version-script=${ORTHANC_ROOT}/OrthancCppClient/Package/Laaw/VersionScript.map" |
49a1228d6fe7
building the dll from the main CMakeLists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
514
diff
changeset
|
55 ) |
506 | 56 target_link_libraries(OrthancCppClient pthread) |
510 | 57 else() |
516
49a1228d6fe7
building the dll from the main CMakeLists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
514
diff
changeset
|
58 set_target_properties(OrthancCppClient |
49a1228d6fe7
building the dll from the main CMakeLists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
514
diff
changeset
|
59 PROPERTIES LINK_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--allow-multiple-definition -static-libgcc -static-libstdc++" |
49a1228d6fe7
building the dll from the main CMakeLists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
514
diff
changeset
|
60 ) |
510 | 61 target_link_libraries(OrthancCppClient ws2_32) |
506 | 62 endif() |