comparison Resources/Samples/RestApiStandalone/CMakeLists.txt @ 322:7233461e2f61

new sample
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 07 Jan 2013 15:33:53 +0100
parents
children 25514c48e30e
comparison
equal deleted inserted replaced
321:47a709e22d1f 322:7233461e2f61
1 cmake_minimum_required(VERSION 2.8)
2
3 project(RestApiSample)
4
5 file(DOWNLOAD
6 http://mongoose.googlecode.com/files/mongoose-3.1.tgz
7 ${CMAKE_BINARY_DIR}/mongoose-3.1.tar.gz
8 EXPECTED_MD5 "e718fc287b4eb1bd523be3fa00942bb0"
9 SHOW_PROGRESS
10 )
11
12 file(DOWNLOAD
13 http://downloads.sourceforge.net/project/jsoncpp/jsoncpp/0.5.0/jsoncpp-src-0.5.0.tar.gz
14 ${CMAKE_BINARY_DIR}/jsoncpp-src-0.5.0.tar.gz
15 EXPECTED_MD5 "24482b67c1cb17aac1ed1814288a3a8f"
16 SHOW_PROGRESS
17 )
18
19 execute_process(
20 COMMAND hg clone -v -r Orthanc-0.4.0 https://code.google.com/p/orthanc/ Orthanc-0.4.0
21 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
22 )
23
24 execute_process(
25 COMMAND ${CMAKE_COMMAND} -E tar xvfz ${CMAKE_BINARY_DIR}/mongoose-3.1.tar.gz
26 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
27 )
28
29 execute_process(
30 COMMAND ${CMAKE_COMMAND} -E tar xvfz ${CMAKE_BINARY_DIR}/jsoncpp-src-0.5.0.tar.gz
31 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
32 )
33
34 include(AutoGeneratedCode.cmake)
35
36 add_definitions(
37 -DBOOST_HAS_FILESYSTEM_V3=1
38 -DBOOST_HAS_SCHED_YIELD=1
39 -DORTHANC_SSL_ENABLED=1
40 -DORTHANC_STANDALONE=1
41 -DORTHANC_STATIC=0
42 )
43
44 set(ORTHANC_DIR ${CMAKE_BINARY_DIR}/Orthanc-0.4.0)
45 set(MONGOOSE_DIR ${CMAKE_BINARY_DIR}/mongoose)
46 set(JSONCPP_DIR ${CMAKE_BINARY_DIR}/jsoncpp-src-0.5.0)
47
48 include_directories(
49 ${ORTHANC_DIR}
50 ${MONGOOSE_DIR}
51 ${JSONCPP_DIR}/include
52 )
53
54 link_libraries(
55 boost_date_time
56 boost_filesystem
57 boost_system
58 boost_thread
59 curl
60 dl
61 glog
62 png
63 pthread
64 sqlite3
65 uuid
66 z
67 )
68
69 set(THIRD_PARTY_SOURCES
70 ${MONGOOSE_DIR}/mongoose.c
71 ${JSONCPP_DIR}/src/lib_json/json_reader.cpp
72 ${JSONCPP_DIR}/src/lib_json/json_value.cpp
73 ${JSONCPP_DIR}/src/lib_json/json_writer.cpp
74 )
75
76 file(GLOB ORTHANC_SOURCES
77 ${ORTHANC_DIR}/Core/*.cpp
78 ${ORTHANC_DIR}/Core/*/*.cpp
79 ${ORTHANC_DIR}/OrthancCppClient/*.cpp
80 ${ORTHANC_DIR}/Resources/base64/base64.cpp
81 ${ORTHANC_DIR}/Resources/md5/md5.c
82 ${ORTHANC_DIR}/Resources/sha1/sha1.cpp
83 ${ORTHANC_DIR}/Resources/minizip/zip.c
84 ${ORTHANC_DIR}/Resources/minizip/ioapi.c
85 )
86
87 list(REMOVE_ITEM ORTHANC_SOURCES ${ORTHANC_DIR}/OrthancCppClient/main.cpp)
88
89 EmbedResources(
90 #ORTHANC_EXPLORER ${ORTHANC_DIR}/OrthancExplorer
91 )
92
93 add_executable(RestApiSample
94 Sample.cpp
95 ${ORTHANC_SOURCES}
96 ${AUTOGENERATED_SOURCES}
97 ${THIRD_PARTY_SOURCES}
98 )