comparison Resources/Samples/RestApiLinuxDynamic/CMakeLists.txt @ 329:f579d50fdf8f

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