Mercurial > hg > orthanc-gcp
view CMakeLists.txt @ 34:eb09eb1251b9
sync
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 01 Jul 2020 16:46:13 +0200 |
parents | acfe1ea3206b |
children | 92b93845d84b |
line wrap: on
line source
cmake_minimum_required(VERSION 2.8) project(GoogleCloudPlatform) set(GCP_PLUGIN_VERSION "mainline") if (GCP_PLUGIN_VERSION STREQUAL "mainline") set(ORTHANC_FRAMEWORK_VERSION "mainline") set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "hg") else() set(ORTHANC_FRAMEWORK_VERSION "1.5.7") set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "web") endif() # Parameters of the build 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(ORTHANC_FRAMEWORK_SOURCE "${ORTHANC_FRAMEWORK_DEFAULT_SOURCE}" CACHE STRING "Source of the Orthanc source code (can be \"hg\", \"archive\", \"web\" or \"path\")") set(ORTHANC_FRAMEWORK_ARCHIVE "" CACHE STRING "Path to the Orthanc archive, if ORTHANC_FRAMEWORK_SOURCE is \"archive\"") set(ORTHANC_FRAMEWORK_ROOT "" CACHE STRING "Path to the Orthanc source directory, if ORTHANC_FRAMEWORK_SOURCE is \"path\"") # Advanced parameters to fine-tune linking against system libraries set(USE_SYSTEM_GDCM ON CACHE BOOL "Use the system version of Grassroot DICOM (GDCM)") set(USE_SYSTEM_ORTHANC_SDK ON CACHE BOOL "Use the system version of the Orthanc plugin SDK") set(ORTHANC_SDK_VERSION "1.0.0" CACHE STRING "Version of the Orthanc plugin SDK to use, if not using the system version (can be \"1.0.0\")") include(${CMAKE_SOURCE_DIR}/Resources/Orthanc/DownloadOrthancFramework.cmake) set(OPENSSL_STATIC_VERSION "1.0.2" CACHE STRING "TODO - Upgrade to OpenSSL 1.1.1" FORCE) include(${ORTHANC_FRAMEWORK_ROOT}/Resources/CMake/OrthancFrameworkParameters.cmake) set(ENABLE_CRYPTO_OPTIONS ON) set(ENABLE_ZLIB ON) set(ENABLE_WEB_CLIENT ON) set(ENABLE_OPENSSL_ENGINES ON) # Necessary on Windows include(${ORTHANC_FRAMEWORK_ROOT}/Resources/CMake/OrthancFrameworkConfiguration.cmake) include(${CMAKE_SOURCE_DIR}/Resources/CMake/CRC32C.cmake) include(${CMAKE_SOURCE_DIR}/Resources/CMake/NlohmannJson.cmake) include(${CMAKE_SOURCE_DIR}/Resources/CMake/GoogleCloudPlatform.cmake) if (STATIC_BUILD OR NOT USE_SYSTEM_ORTHANC_SDK) if (ORTHANC_SDK_VERSION STREQUAL "1.0.0") include_directories(${CMAKE_SOURCE_DIR}/Resources/Orthanc/Sdk-1.0.0) else() message(FATAL_ERROR "Unsupported version of the Orthanc plugin SDK: ${ORTHANC_SDK_VERSION}") endif() else () CHECK_INCLUDE_FILE_CXX(orthanc/OrthancCPlugin.h HAVE_ORTHANC_H) if (NOT HAVE_ORTHANC_H) message(FATAL_ERROR "Please install the headers of the Orthanc plugins SDK") endif() endif() add_definitions( -DHAS_ORTHANC_EXCEPTION=1 -DORTHANC_ENABLE_LOGGING=1 -DORTHANC_ENABLE_LOGGING_PLUGIN=1 -DGCP_PLUGIN_VERSION="${GCP_PLUGIN_VERSION}" ) include_directories( ${AUTOGENERATED_DIR} ${ORTHANC_FRAMEWORK_ROOT}/Sources/ ) if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") execute_process( COMMAND ${PYTHON_EXECUTABLE} ${ORTHANC_FRAMEWORK_ROOT}/Resources/WindowsResources.py ${GCP_PLUGIN_VERSION} "Google Cloud Platform plugin" OrthancGoogleCloudPlatform.dll "Plugin to access Google Cloud Platform from Orthanc" ERROR_VARIABLE Failure OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/Version.rc ) if (Failure) message(FATAL_ERROR "Error while computing the version information: ${Failure}") endif() set(GCP_RESOURCES ${CMAKE_CURRENT_BINARY_DIR}/Version.rc) endif() if (ON) # Redefine the list of Orthanc sources, removing unused items, in # order to reduce the number of files and speed up the builds set(ORTHANC_CORE_SOURCES ${ORTHANC_CORE_SOURCES_DEPENDENCIES} ${ORTHANC_FRAMEWORK_ROOT}/Sources/ChunkedBuffer.cpp ${ORTHANC_FRAMEWORK_ROOT}/Sources/Enumerations.cpp ${ORTHANC_FRAMEWORK_ROOT}/Sources/HttpClient.cpp ${ORTHANC_FRAMEWORK_ROOT}/Sources/Logging.cpp ${ORTHANC_FRAMEWORK_ROOT}/Sources/SystemToolbox.cpp ${ORTHANC_FRAMEWORK_ROOT}/Sources/Toolbox.cpp ) endif() add_library(OrthancGoogleCloudPlatform SHARED ${GCP_RESOURCES} Plugin/GoogleAccount.cpp Plugin/GoogleConfiguration.cpp Plugin/GoogleUpdater.cpp Plugin/Plugin.cpp Resources/Orthanc/Plugins/OrthancPluginCppWrapper.cpp ${CRC32C_SOURCES} ${CURL_SOURCES} ${GCP_SOURCES} ${OPENSSL_SOURCES} ${ZLIB_SOURCES} ${ORTHANC_CORE_SOURCES} ) set_target_properties(OrthancGoogleCloudPlatform PROPERTIES VERSION ${GCP_PLUGIN_VERSION} SOVERSION ${GCP_PLUGIN_VERSION}) install( TARGETS OrthancGoogleCloudPlatform RUNTIME DESTINATION lib # Destination for Windows LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux )