annotate OrthancCppClient/Package/OrthancCppClient.cmake @ 514:a3d9acf37161 laaw

build script
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 18 Jul 2013 12:45:40 +0200
parents 1b8a1c43893e
children 49a1228d6fe7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
6e4bd06c17c5 the wrapper is working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2
6e4bd06c17c5 the wrapper is working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 set(STATIC_BUILD ON)
6e4bd06c17c5 the wrapper is working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 include(${ORTHANC_ROOT}/Resources/CMake/DownloadPackage.cmake)
6e4bd06c17c5 the wrapper is working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 include(${ORTHANC_ROOT}/Resources/CMake/JsonCppConfiguration.cmake)
6e4bd06c17c5 the wrapper is working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 include(${ORTHANC_ROOT}/Resources/CMake/LibCurlConfiguration.cmake)
6e4bd06c17c5 the wrapper is working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 include(${ORTHANC_ROOT}/Resources/CMake/LibPngConfiguration.cmake)
6e4bd06c17c5 the wrapper is working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 include(${ORTHANC_ROOT}/Resources/CMake/BoostConfiguration.cmake)
6e4bd06c17c5 the wrapper is working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 include(${ORTHANC_ROOT}/Resources/CMake/ZlibConfiguration.cmake)
6e4bd06c17c5 the wrapper is working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10
6e4bd06c17c5 the wrapper is working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 if (${CMAKE_COMPILER_IS_GNUCXX})
6e4bd06c17c5 the wrapper is working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -pedantic -Wno-implicit-function-declaration") # --std=c99 makes libcurl not to compile
6e4bd06c17c5 the wrapper is working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Wno-long-long -Wno-variadic-macros")
6e4bd06c17c5 the wrapper is working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed")
6e4bd06c17c5 the wrapper is working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
6e4bd06c17c5 the wrapper is working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 elseif (${MSVC})
6e4bd06c17c5 the wrapper is working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 add_definitions(-D_CRT_SECURE_NO_WARNINGS=1)
6e4bd06c17c5 the wrapper is working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 endif()
6e4bd06c17c5 the wrapper is working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
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
6e4bd06c17c5 the wrapper is working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 add_library(OrthancCppClient SHARED
6e4bd06c17c5 the wrapper is working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 ${THIRD_PARTY_SOURCES}
6e4bd06c17c5 the wrapper is working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 ${ORTHANC_ROOT}/Core/OrthancException.cpp
6e4bd06c17c5 the wrapper is working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 ${ORTHANC_ROOT}/Core/Enumerations.cpp
6e4bd06c17c5 the wrapper is working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 ${ORTHANC_ROOT}/Core/Toolbox.cpp
6e4bd06c17c5 the wrapper is working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 ${ORTHANC_ROOT}/Core/HttpClient.cpp
6e4bd06c17c5 the wrapper is working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 ${ORTHANC_ROOT}/Core/MultiThreading/ArrayFilledByThreads.cpp
6e4bd06c17c5 the wrapper is working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 ${ORTHANC_ROOT}/Core/MultiThreading/ThreadedCommandProcessor.cpp
6e4bd06c17c5 the wrapper is working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 ${ORTHANC_ROOT}/Core/MultiThreading/SharedMessageQueue.cpp
6e4bd06c17c5 the wrapper is working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 ${ORTHANC_ROOT}/Core/FileFormats/PngReader.cpp
6e4bd06c17c5 the wrapper is working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 ${ORTHANC_ROOT}/OrthancCppClient/OrthancConnection.cpp
6e4bd06c17c5 the wrapper is working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 ${ORTHANC_ROOT}/OrthancCppClient/Series.cpp
6e4bd06c17c5 the wrapper is working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 ${ORTHANC_ROOT}/OrthancCppClient/Study.cpp
6e4bd06c17c5 the wrapper is working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 ${ORTHANC_ROOT}/OrthancCppClient/Instance.cpp
6e4bd06c17c5 the wrapper is working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
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
6e4bd06c17c5 the wrapper is working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 ${ORTHANC_ROOT}/Resources/sha1/sha1.cpp
6e4bd06c17c5 the wrapper is working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 ${ORTHANC_ROOT}/Resources/md5/md5.c
6e4bd06c17c5 the wrapper is working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
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
6e4bd06c17c5 the wrapper is working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 )
6e4bd06c17c5 the wrapper is working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51
6e4bd06c17c5 the wrapper is working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
512
1b8a1c43893e compilation of the dll 32/64
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 510
diff changeset
53 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--version-script=${ORTHANC_ROOT}/OrthancCppClient/Package/Laaw/VersionScript.map")
506
6e4bd06c17c5 the wrapper is working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 target_link_libraries(OrthancCppClient pthread)
510
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 506
diff changeset
55 else()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 506
diff changeset
56 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--allow-multiple-definition -static-libgcc -static-libstdc++")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 506
diff changeset
57 target_link_libraries(OrthancCppClient ws2_32)
506
6e4bd06c17c5 the wrapper is working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 endif()