annotate Resources/Samples/RestApiLinuxDynamic/CMakeLists.txt @ 458:84966299c8f8

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