Mercurial > hg > orthanc
annotate Plugins/Samples/DatabasePlugin/CMakeLists.txt @ 2137:595cf22b3e7e
safety checks of macros
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 09 Nov 2016 15:07:50 +0100 |
parents | dd609a99d39a |
children | 41b70d5b44c9 |
rev | line source |
---|---|
1671 | 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 | |
2136
dd609a99d39a
uniformization of the macro naming
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1761
diff
changeset
|
35 -DORTHANC_ENABLE_PLUGINS=1 |
1671 | 36 -DSAMPLE_DATABASE_VERSION="${SAMPLE_DATABASE_VERSION}" |
37 ) | |
38 | |
39 add_library(SampleDatabase SHARED | |
40 ${BOOST_SOURCES} | |
41 ${JSONCPP_SOURCES} | |
42 ${SQLITE_SOURCES} | |
43 ${AUTOGENERATED_SOURCES} | |
44 | |
45 ${ORTHANC_ROOT}/Core/DicomFormat/DicomArray.cpp | |
46 ${ORTHANC_ROOT}/Core/DicomFormat/DicomMap.cpp | |
47 ${ORTHANC_ROOT}/Core/DicomFormat/DicomTag.cpp | |
1761
f4286d99ee0a
fix sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1671
diff
changeset
|
48 ${ORTHANC_ROOT}/Core/DicomFormat/DicomValue.cpp |
1671 | 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 ) |