276
|
1 cmake_minimum_required(VERSION 2.8)
|
|
2
|
|
3 project(RestApiSample)
|
|
4
|
|
5 include(ExternalProject)
|
|
6
|
|
7 ExternalProject_Add(
|
|
8 ORTHANC_CORE
|
|
9 PREFIX ${CMAKE_BINARY_DIR}/Orthanc/
|
|
10 DOWNLOAD_COMMAND hg clone https://code.google.com/p/orthanc/ -r Orthanc-0.3.1
|
|
11 UPDATE_COMMAND ""
|
|
12 SOURCE_DIR ${CMAKE_BINARY_DIR}/Orthanc/src/orthanc/
|
|
13
|
|
14 # Optional step, to reuse the third-party downloads
|
|
15 PATCH_COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_SOURCE_DIR}/../../../ThirdPartyDownloads ThirdPartyDownloads
|
|
16
|
|
17 CMAKE_COMMAND ${CMAKE_COMMAND}
|
|
18 CMAKE_ARGS -DSTATIC_BUILD=ON -DSTANDALONE_BUILD=ON -DUSE_DYNAMIC_GOOGLE_LOG=OFF -DUSE_DYNAMIC_SQLITE=OFF -DONLY_CORE_LIBRARY=ON -DENABLE_SSL=OFF
|
|
19 BUILD_COMMAND $(MAKE)
|
|
20 INSTALL_COMMAND ""
|
|
21 BUILD_IN_SOURCE 0
|
|
22 )
|
|
23
|
|
24 ExternalProject_Get_Property(ORTHANC_CORE source_dir)
|
|
25 include_directories(${source_dir})
|
|
26
|
|
27 ExternalProject_Get_Property(ORTHANC_CORE binary_dir)
|
|
28 link_directories(${binary_dir})
|
|
29 include_directories(${binary_dir}/jsoncpp-src-0.5.0/include)
|
|
30 include_directories(${binary_dir}/glog-0.3.2/src)
|
|
31
|
|
32 add_executable(RestApiSample
|
|
33 Sample.cpp
|
|
34 )
|
|
35
|
|
36 add_dependencies(RestApiSample ORTHANC_CORE)
|
|
37
|
|
38 target_link_libraries(RestApiSample
|
|
39 # From Orthanc
|
|
40 CoreLibrary
|
|
41 GoogleLog
|
|
42 #OpenSSL
|
|
43
|
|
44 # System-wide libraries
|
|
45 pthread
|
|
46 )
|
|
47
|