Mercurial > hg > orthanc
comparison Plugins/Samples/DatabasePlugin/CMakeLists.txt @ 1671:2f2e2ec17bc4 db-changes
sample database plugin
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 01 Oct 2015 17:44:43 +0200 |
parents | |
children | f4286d99ee0a |
comparison
equal
deleted
inserted
replaced
1670:16955f8fec4d | 1671:2f2e2ec17bc4 |
---|---|
1 cmake_minimum_required(VERSION 2.8) | |
2 | |
3 project(SampleDatabasePlugin) | |
4 | |
5 # Parameters of the build | |
6 SET(SAMPLE_DATABASE_VERSION "0.0" CACHE STRING "Version of the plugin") | |
7 SET(STATIC_BUILD OFF CACHE BOOL "Static build of the third-party libraries (necessary for Windows)") | |
8 SET(ALLOW_DOWNLOADS OFF CACHE BOOL "Allow CMake to download packages") | |
9 SET(STANDALONE_BUILD ON) | |
10 | |
11 # Advanced parameters to fine-tune linking against system libraries | |
12 SET(USE_SYSTEM_BOOST ON CACHE BOOL "Use the system version of Boost") | |
13 SET(USE_SYSTEM_JSONCPP ON CACHE BOOL "Use the system version of JsonCpp") | |
14 SET(USE_SYSTEM_SQLITE ON CACHE BOOL "Use the system version of SQLite") | |
15 | |
16 set(SAMPLES_ROOT ${CMAKE_SOURCE_DIR}/..) | |
17 include(${SAMPLES_ROOT}/Common/OrthancPlugins.cmake) | |
18 | |
19 include(${ORTHANC_ROOT}/Resources/CMake/BoostConfiguration.cmake) | |
20 include(${ORTHANC_ROOT}/Resources/CMake/JsonCppConfiguration.cmake) | |
21 include(${ORTHANC_ROOT}/Resources/CMake/SQLiteConfiguration.cmake) | |
22 | |
23 EmbedResources( | |
24 --system-exception # Use "std::runtime_error" instead of "OrthancException" for embedded resources | |
25 PREPARE_DATABASE ${ORTHANC_ROOT}/OrthancServer/PrepareDatabase.sql | |
26 ) | |
27 | |
28 message("Setting the version of the plugin to ${SAMPLE_DATABASE_VERSION}") | |
29 | |
30 add_definitions( | |
31 -DORTHANC_SQLITE_STANDALONE=1 | |
32 -DORTHANC_ENABLE_LOGGING=0 | |
33 -DORTHANC_ENABLE_BASE64=0 | |
34 -DORTHANC_ENABLE_MD5=0 | |
35 -DORTHANC_ENABLE_DCMTK=0 | |
36 -DORTHANC_PLUGINS_ENABLED=1 | |
37 -DSAMPLE_DATABASE_VERSION="${SAMPLE_DATABASE_VERSION}" | |
38 ) | |
39 | |
40 add_library(SampleDatabase SHARED | |
41 ${BOOST_SOURCES} | |
42 ${JSONCPP_SOURCES} | |
43 ${SQLITE_SOURCES} | |
44 ${AUTOGENERATED_SOURCES} | |
45 | |
46 ${ORTHANC_ROOT}/Core/DicomFormat/DicomArray.cpp | |
47 ${ORTHANC_ROOT}/Core/DicomFormat/DicomMap.cpp | |
48 ${ORTHANC_ROOT}/Core/DicomFormat/DicomTag.cpp | |
49 ${ORTHANC_ROOT}/Core/Enumerations.cpp | |
50 ${ORTHANC_ROOT}/Core/SQLite/Connection.cpp | |
51 ${ORTHANC_ROOT}/Core/SQLite/FunctionContext.cpp | |
52 ${ORTHANC_ROOT}/Core/SQLite/Statement.cpp | |
53 ${ORTHANC_ROOT}/Core/SQLite/StatementId.cpp | |
54 ${ORTHANC_ROOT}/Core/SQLite/StatementReference.cpp | |
55 ${ORTHANC_ROOT}/Core/SQLite/Transaction.cpp | |
56 ${ORTHANC_ROOT}/Core/Toolbox.cpp | |
57 ${ORTHANC_ROOT}/OrthancServer/DatabaseWrapperBase.cpp | |
58 ${ORTHANC_ROOT}/Plugins/Engine/PluginsEnumerations.cpp | |
59 | |
60 Database.cpp | |
61 Plugin.cpp | |
62 ) | |
63 | |
64 set_target_properties(SampleDatabase PROPERTIES | |
65 VERSION ${SAMPLE_DATABASE_VERSION} | |
66 SOVERSION ${SAMPLE_DATABASE_VERSION}) | |
67 | |
68 install( | |
69 TARGETS SampleDatabase | |
70 RUNTIME DESTINATION lib # Destination for Windows | |
71 LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux | |
72 ) |