Mercurial > hg > orthanc
diff CMakeLists.txt @ 1589:334d3a92ed83
improvements to the ServeFolders plugin
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 26 Aug 2015 17:43:00 +0200 |
parents | 09715095fc53 |
children | 292bce3f54ed |
line wrap: on
line diff
--- a/CMakeLists.txt Wed Aug 26 16:49:46 2015 +0200 +++ b/CMakeLists.txt Wed Aug 26 17:43:00 2015 +0200 @@ -29,6 +29,7 @@ SET(ENABLE_JPEG ON CACHE BOOL "Enable JPEG decompression") SET(ENABLE_JPEG_LOSSLESS ON CACHE BOOL "Enable JPEG-LS (Lossless) decompression") SET(ENABLE_PLUGINS ON CACHE BOOL "Enable plugins") +SET(BUILD_SERVE_FOLDERS ON CACHE BOOL "Build the ServeFolders plugin") # Advanced parameters to fine-tune linking against system libraries SET(USE_SYSTEM_JSONCPP ON CACHE BOOL "Use the system version of JsonCpp") @@ -221,10 +222,6 @@ list(APPEND ORTHANC_UNIT_TESTS_SOURCES UnitTestsSources/PluginsTests.cpp ) - - set(SERVE_FOLDERS_SOURCES - Plugins/Samples/ServeFolders/Plugin.cpp - ) endif() @@ -328,20 +325,7 @@ message(FATAL_ERROR "Error while computing the version information: ${Failure}") endif() - execute_process( - COMMAND - ${PYTHON_EXECUTABLE} ${ORTHANC_ROOT}/Resources/WindowsResources.py - ${ORTHANC_VERSION} ServeFolders ServeFolders.dll "Orthanc plugin to serve additional folders" - ERROR_VARIABLE Failure - OUTPUT_FILE ${AUTOGENERATED_DIR}/ServeFolders.rc - ) - - if (Failure) - message(FATAL_ERROR "Error while computing the version information: ${Failure}") - endif() - list(APPEND ORTHANC_RESOURCES ${AUTOGENERATED_DIR}/Orthanc.rc) - list(APPEND SERVE_FOLDERS_SOURCES ${AUTOGENERATED_DIR}/ServeFolders.rc) endif() @@ -464,15 +448,28 @@ ## Build the "ServeFolders" plugin ##################################################################### -if (ENABLE_PLUGINS) +if (ENABLE_PLUGINS AND BUILD_SERVE_FOLDERS) + execute_process( + COMMAND + ${PYTHON_EXECUTABLE} ${ORTHANC_ROOT}/Resources/WindowsResources.py + ${ORTHANC_VERSION} ServeFolders ServeFolders.dll "Orthanc plugin to serve additional folders" + ERROR_VARIABLE Failure + OUTPUT_FILE ${AUTOGENERATED_DIR}/ServeFolders.rc + ) + + if (Failure) + message(FATAL_ERROR "Error while computing the version information: ${Failure}") + endif() + add_definitions(-DSERVE_FOLDERS_VERSION="${ORTHANC_VERSION}") include_directories(${CMAKE_SOURCE_DIR}/Plugins/Include) - add_library( - ServeFolders SHARED - ${SERVE_FOLDERS_SOURCES} + add_library(ServeFolders SHARED + ${BOOST_SOURCES} ${JSONCPP_SOURCES} + Plugins/Samples/ServeFolders/Plugin.cpp + ${AUTOGENERATED_DIR}/ServeFolders.rc ) set_target_properties(