Mercurial > hg > orthanc-wsi
diff Resources/Orthanc/DownloadOrthancFramework.cmake @ 194:e57e6ca5303d
sync
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 30 Jun 2020 18:03:23 +0200 |
parents | e690c265b315 |
children | b0bd22077cd8 |
line wrap: on
line diff
--- a/Resources/Orthanc/DownloadOrthancFramework.cmake Tue Jun 30 10:10:55 2020 +0200 +++ b/Resources/Orthanc/DownloadOrthancFramework.cmake Tue Jun 30 18:03:23 2020 +0200 @@ -195,10 +195,8 @@ endif() if (NOT EXISTS ${ORTHANC_FRAMEWORK_ROOT}/Resources/CMake/OrthancFrameworkParameters.cmake) - message(FATAL_ERROR "Directory not containing the source code of Orthanc: ${ORTHANC_FRAMEWORK_ROOT}") + message(FATAL_ERROR "Directory not containing the source code of the Orthanc framework: ${ORTHANC_FRAMEWORK_ROOT}") endif() - - set(ORTHANC_ROOT ${ORTHANC_FRAMEWORK_ROOT}) endif() @@ -245,6 +243,16 @@ if (Failure) message(FATAL_ERROR "Error while running Mercurial") endif() + + unset(ORTHANC_FRAMEWORK_ROOT CACHE) + set(ORTHANC_FRAMEWORK_ROOT "${ORTHANC_ROOT}/OrthancFramework" CACHE + STRING "Path to the Orthanc framework source directory") + + if (NOT EXISTS ${ORTHANC_FRAMEWORK_ROOT}/Resources/CMake/OrthancFrameworkParameters.cmake) + message(FATAL_ERROR "Directory not containing the source code of the Orthanc framework: ${ORTHANC_ROOT}") + endif() + + unset(ORTHANC_ROOT) endif() @@ -372,6 +380,16 @@ message(FATAL_ERROR "The Orthanc framework was not uncompressed at the proper location. Check the CMake instructions.") endif() endif() + + unset(ORTHANC_FRAMEWORK_ROOT CACHE) + set(ORTHANC_FRAMEWORK_ROOT "${ORTHANC_ROOT}/OrthancFramework" CACHE + STRING "Path to the Orthanc framework source directory") + + if (NOT EXISTS ${ORTHANC_FRAMEWORK_ROOT}/Resources/CMake/OrthancFrameworkParameters.cmake) + message(FATAL_ERROR "Directory not containing the source code of the Orthanc framework: ${ORTHANC_ROOT}") + endif() + + unset(ORTHANC_ROOT) endif() @@ -399,8 +417,10 @@ include(${CMAKE_CURRENT_LIST_DIR}/AutoGeneratedCode.cmake) set(EMBED_RESOURCES_PYTHON ${CMAKE_CURRENT_LIST_DIR}/EmbedResources.py) - if (NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows" AND - NOT ORTHANC_FRAMEWORK_STATIC) + if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows" OR + ORTHANC_FRAMEWORK_STATIC) + include_directories(${ORTHANC_FRAMEWORK_ROOT}/..) + else() # Look for mandatory dependency JsonCpp (cf. JsonCppConfiguration.cmake) find_path(JSONCPP_INCLUDE_DIR json/reader.h /usr/include/jsoncpp @@ -447,6 +467,22 @@ endif() link_libraries(sqlite3) endif() + + # Optional component - Pugixml + if (ENABLE_PUGIXML) + CHECK_INCLUDE_FILE_CXX(pugixml.hpp HAVE_PUGIXML_H) + if (NOT HAVE_PUGIXML_H) + message(FATAL_ERROR "Please install the libpugixml-dev package") + endif() + link_libraries(pugixml) + endif() + + # Optional component - DCMTK + if (ENABLE_DCMTK) + include(FindDCMTK) + include_directories(${DCMTK_INCLUDE_DIRS}) + link_libraries(${DCMTK_LIBRARIES}) + endif() endif() # Optional component - Google Test @@ -462,7 +498,6 @@ if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows") set(ORTHANC_FRAMEWORK_INCLUDE_DIR ${ORTHANC_FRAMEWORK_ROOT}) - include_directories(${ORTHANC_FRAMEWORK_ROOT}/..) else() find_path(ORTHANC_FRAMEWORK_INCLUDE_DIR OrthancFramework.h /usr/include/orthanc-framework