Mercurial > hg > orthanc
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Plugins/Samples/DatabasePlugin/CMakeLists.txt Thu Oct 01 17:44:43 2015 +0200 @@ -0,0 +1,72 @@ +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_LOGGING=0 + -DORTHANC_ENABLE_BASE64=0 + -DORTHANC_ENABLE_MD5=0 + -DORTHANC_ENABLE_DCMTK=0 + -DORTHANC_PLUGINS_ENABLED=1 + -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/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 + )