comparison Resources/Graveyard/DatabasePluginSample/CMakeLists.txt @ 2772:f3df536e7366

moving the outdated database plugin sample into the graveyard
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 17 Jul 2018 11:02:18 +0200
parents Plugins/Samples/DatabasePlugin/CMakeLists.txt@a979ded1dbb1
children
comparison
equal deleted inserted replaced
2740:e226f3a23f2f 2772:f3df536e7366
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_BASE64=0
33 -DORTHANC_ENABLE_LOGGING=0
34 -DORTHANC_ENABLE_MD5=0
35 -DORTHANC_ENABLE_PLUGINS=1
36 -DORTHANC_ENABLE_PUGIXML=0
37 -DORTHANC_SANDBOXED=0
38 -DSAMPLE_DATABASE_VERSION="${SAMPLE_DATABASE_VERSION}"
39 )
40
41 add_library(SampleDatabase SHARED
42 ${BOOST_SOURCES}
43 ${JSONCPP_SOURCES}
44 ${SQLITE_SOURCES}
45 ${AUTOGENERATED_SOURCES}
46
47 ${ORTHANC_ROOT}/Core/DicomFormat/DicomArray.cpp
48 ${ORTHANC_ROOT}/Core/DicomFormat/DicomMap.cpp
49 ${ORTHANC_ROOT}/Core/DicomFormat/DicomTag.cpp
50 ${ORTHANC_ROOT}/Core/DicomFormat/DicomValue.cpp
51 ${ORTHANC_ROOT}/Core/Enumerations.cpp
52 ${ORTHANC_ROOT}/Core/SQLite/Connection.cpp
53 ${ORTHANC_ROOT}/Core/SQLite/FunctionContext.cpp
54 ${ORTHANC_ROOT}/Core/SQLite/Statement.cpp
55 ${ORTHANC_ROOT}/Core/SQLite/StatementId.cpp
56 ${ORTHANC_ROOT}/Core/SQLite/StatementReference.cpp
57 ${ORTHANC_ROOT}/Core/SQLite/Transaction.cpp
58 ${ORTHANC_ROOT}/Core/Toolbox.cpp
59 ${ORTHANC_ROOT}/OrthancServer/DatabaseWrapperBase.cpp
60 ${ORTHANC_ROOT}/Plugins/Engine/PluginsEnumerations.cpp
61
62 Database.cpp
63 Plugin.cpp
64 )
65
66 set_target_properties(SampleDatabase PROPERTIES
67 VERSION ${SAMPLE_DATABASE_VERSION}
68 SOVERSION ${SAMPLE_DATABASE_VERSION})
69
70 install(
71 TARGETS SampleDatabase
72 RUNTIME DESTINATION lib # Destination for Windows
73 LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux
74 )