Newer
Older
cmake_minimum_required(VERSION 2.8)
project(SampleDatabasePlugin)
# Parameters of the build
SET(SAMPLE_DATABASE_VERSION "0.0" CACHE STRING "Version of the plugin")
SET(STATIC_BUILD OFF CACHE BOOL "Static build of the third-party libraries (necessary for Windows)")
SET(ALLOW_DOWNLOADS OFF CACHE BOOL "Allow CMake to download packages")
SET(STANDALONE_BUILD ON)
# Advanced parameters to fine-tune linking against system libraries
SET(USE_SYSTEM_BOOST ON CACHE BOOL "Use the system version of Boost")
SET(USE_SYSTEM_JSONCPP ON CACHE BOOL "Use the system version of JsonCpp")
SET(USE_SYSTEM_SQLITE ON CACHE BOOL "Use the system version of SQLite")
set(SAMPLES_ROOT ${CMAKE_SOURCE_DIR}/..)
include(${SAMPLES_ROOT}/Common/OrthancPlugins.cmake)
include(${ORTHANC_ROOT}/Resources/CMake/BoostConfiguration.cmake)
include(${ORTHANC_ROOT}/Resources/CMake/JsonCppConfiguration.cmake)
include(${ORTHANC_ROOT}/Resources/CMake/SQLiteConfiguration.cmake)
EmbedResources(
--system-exception # Use "std::runtime_error" instead of "OrthancException" for embedded resources
PREPARE_DATABASE ${ORTHANC_ROOT}/OrthancServer/PrepareDatabase.sql
)
message("Setting the version of the plugin to ${SAMPLE_DATABASE_VERSION}")
add_definitions(
-DORTHANC_SQLITE_STANDALONE=1
-DORTHANC_ENABLE_BASE64=0
-DORTHANC_ENABLE_PLUGINS=1
-DORTHANC_ENABLE_PUGIXML=0
-DORTHANC_SANDBOXED=0
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
-DSAMPLE_DATABASE_VERSION="${SAMPLE_DATABASE_VERSION}"
)
add_library(SampleDatabase SHARED
${BOOST_SOURCES}
${JSONCPP_SOURCES}
${SQLITE_SOURCES}
${AUTOGENERATED_SOURCES}
${ORTHANC_ROOT}/Core/DicomFormat/DicomArray.cpp
${ORTHANC_ROOT}/Core/DicomFormat/DicomMap.cpp
${ORTHANC_ROOT}/Core/DicomFormat/DicomTag.cpp
${ORTHANC_ROOT}/Core/DicomFormat/DicomValue.cpp
${ORTHANC_ROOT}/Core/Enumerations.cpp
${ORTHANC_ROOT}/Core/SQLite/Connection.cpp
${ORTHANC_ROOT}/Core/SQLite/FunctionContext.cpp
${ORTHANC_ROOT}/Core/SQLite/Statement.cpp
${ORTHANC_ROOT}/Core/SQLite/StatementId.cpp
${ORTHANC_ROOT}/Core/SQLite/StatementReference.cpp
${ORTHANC_ROOT}/Core/SQLite/Transaction.cpp
${ORTHANC_ROOT}/Core/Toolbox.cpp
${ORTHANC_ROOT}/OrthancServer/DatabaseWrapperBase.cpp
${ORTHANC_ROOT}/Plugins/Engine/PluginsEnumerations.cpp
Database.cpp
Plugin.cpp
)
set_target_properties(SampleDatabase PROPERTIES
VERSION ${SAMPLE_DATABASE_VERSION}
SOVERSION ${SAMPLE_DATABASE_VERSION})
install(
TARGETS SampleDatabase
RUNTIME DESTINATION lib # Destination for Windows
LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux
)