Mercurial > hg > orthanc
annotate Resources/Samples/RestApi/CMakeLists.txt @ 407:2d269089078f
reintegration of lua scripting into mainline
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 02 May 2013 16:49:28 +0200 |
parents | eb5fb5501569 |
children | b2b56b4e33b0 |
rev | line source |
---|---|
276 | 1 cmake_minimum_required(VERSION 2.8) |
2 | |
3 project(RestApiSample) | |
4 | |
5 include(ExternalProject) | |
6 | |
279
eb5fb5501569
the REST API sample can now be built with the MinGWToolchain.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
276
diff
changeset
|
7 # Send the toolchain information to the Orthanc |
eb5fb5501569
the REST API sample can now be built with the MinGWToolchain.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
276
diff
changeset
|
8 if (CMAKE_TOOLCHAIN_FILE) |
eb5fb5501569
the REST API sample can now be built with the MinGWToolchain.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
276
diff
changeset
|
9 set(TOOLCHAIN "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}") |
eb5fb5501569
the REST API sample can now be built with the MinGWToolchain.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
276
diff
changeset
|
10 endif() |
eb5fb5501569
the REST API sample can now be built with the MinGWToolchain.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
276
diff
changeset
|
11 |
276 | 12 ExternalProject_Add( |
13 ORTHANC_CORE | |
279
eb5fb5501569
the REST API sample can now be built with the MinGWToolchain.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
276
diff
changeset
|
14 |
eb5fb5501569
the REST API sample can now be built with the MinGWToolchain.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
276
diff
changeset
|
15 # We use the Orthanc-0.3.1 branch for this sample |
276 | 16 DOWNLOAD_COMMAND hg clone https://code.google.com/p/orthanc/ -r Orthanc-0.3.1 |
17 | |
18 # Optional step, to reuse the third-party downloads | |
19 PATCH_COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_SOURCE_DIR}/../../../ThirdPartyDownloads ThirdPartyDownloads | |
20 | |
279
eb5fb5501569
the REST API sample can now be built with the MinGWToolchain.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
276
diff
changeset
|
21 PREFIX ${CMAKE_BINARY_DIR}/Orthanc/ |
eb5fb5501569
the REST API sample can now be built with the MinGWToolchain.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
276
diff
changeset
|
22 UPDATE_COMMAND "" |
eb5fb5501569
the REST API sample can now be built with the MinGWToolchain.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
276
diff
changeset
|
23 SOURCE_DIR ${CMAKE_BINARY_DIR}/Orthanc/src/orthanc/ |
276 | 24 CMAKE_COMMAND ${CMAKE_COMMAND} |
279
eb5fb5501569
the REST API sample can now be built with the MinGWToolchain.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
276
diff
changeset
|
25 CMAKE_ARGS -DSTATIC_BUILD=ON -DSTANDALONE_BUILD=ON -DUSE_DYNAMIC_GOOGLE_LOG=OFF -DUSE_DYNAMIC_SQLITE=OFF -DONLY_CORE_LIBRARY=ON -DENABLE_SSL=OFF ${TOOLCHAIN} |
276 | 26 BUILD_COMMAND $(MAKE) |
27 INSTALL_COMMAND "" | |
28 BUILD_IN_SOURCE 0 | |
279
eb5fb5501569
the REST API sample can now be built with the MinGWToolchain.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
276
diff
changeset
|
29 ) |
276 | 30 |
31 ExternalProject_Get_Property(ORTHANC_CORE source_dir) | |
32 include_directories(${source_dir}) | |
33 | |
34 ExternalProject_Get_Property(ORTHANC_CORE binary_dir) | |
35 link_directories(${binary_dir}) | |
36 include_directories(${binary_dir}/jsoncpp-src-0.5.0/include) | |
37 include_directories(${binary_dir}/glog-0.3.2/src) | |
279
eb5fb5501569
the REST API sample can now be built with the MinGWToolchain.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
276
diff
changeset
|
38 include_directories(${binary_dir}/boost_1_49_0) |
eb5fb5501569
the REST API sample can now be built with the MinGWToolchain.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
276
diff
changeset
|
39 |
276 | 40 |
41 add_executable(RestApiSample | |
42 Sample.cpp | |
43 ) | |
44 | |
45 add_dependencies(RestApiSample ORTHANC_CORE) | |
46 | |
47 target_link_libraries(RestApiSample | |
48 # From Orthanc | |
49 CoreLibrary | |
50 GoogleLog | |
279
eb5fb5501569
the REST API sample can now be built with the MinGWToolchain.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
276
diff
changeset
|
51 |
eb5fb5501569
the REST API sample can now be built with the MinGWToolchain.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
276
diff
changeset
|
52 # These two libraries are not necessary |
276 | 53 #OpenSSL |
279
eb5fb5501569
the REST API sample can now be built with the MinGWToolchain.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
276
diff
changeset
|
54 #Curl |
276 | 55 ) |
56 | |
279
eb5fb5501569
the REST API sample can now be built with the MinGWToolchain.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
276
diff
changeset
|
57 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") |
eb5fb5501569
the REST API sample can now be built with the MinGWToolchain.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
276
diff
changeset
|
58 target_link_libraries(RestApiSample pthread) |
eb5fb5501569
the REST API sample can now be built with the MinGWToolchain.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
276
diff
changeset
|
59 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") |
eb5fb5501569
the REST API sample can now be built with the MinGWToolchain.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
276
diff
changeset
|
60 add_definitions(-DGOOGLE_GLOG_DLL_DECL=) |
eb5fb5501569
the REST API sample can now be built with the MinGWToolchain.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
276
diff
changeset
|
61 target_link_libraries(RestApiSample wsock32) |
eb5fb5501569
the REST API sample can now be built with the MinGWToolchain.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
276
diff
changeset
|
62 endif() |