Mercurial > hg > orthanc-postgresql
changeset 173:c5ef9c029a4c
sync
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 17 Apr 2018 11:46:16 +0200 |
parents | fa8819999d0d |
children | 4ecd23ad4169 |
files | CMakeLists.txt Resources/Orthanc/DownloadOrthancFramework.cmake |
diffstat | 2 files changed, 12 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/CMakeLists.txt Tue Apr 17 11:35:11 2018 +0200 +++ b/CMakeLists.txt Tue Apr 17 11:46:16 2018 +0200 @@ -25,8 +25,10 @@ if (ORTHANC_POSTGRESQL_VERSION STREQUAL "mainline") set(ORTHANC_FRAMEWORK_VERSION "mainline") + set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "hg") else() set(ORTHANC_FRAMEWORK_VERSION "1.3.1") + set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "web") endif() @@ -34,7 +36,7 @@ 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(BUILD_UNIT_TESTS ON CACHE BOOL "Build UnitTests") -set(ORTHANC_FRAMEWORK_SOURCE "hg" CACHE STRING "Source of the Orthanc source code (can be \"hg\", \"archive\", \"web\" or \"path\")") +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\"")
--- a/Resources/Orthanc/DownloadOrthancFramework.cmake Tue Apr 17 11:35:11 2018 +0200 +++ b/Resources/Orthanc/DownloadOrthancFramework.cmake Tue Apr 17 11:46:16 2018 +0200 @@ -43,16 +43,6 @@ endif() -if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "hg" OR - ORTHANC_FRAMEWORK_SOURCE STREQUAL "web") - if (NOT STATIC_BUILD AND - NOT ALLOW_DOWNLOADS) - message(FATAL_ERROR "CMake is not allowed to download from Internet. Please set the ALLOW_DOWNLOADS option to ON") - endif() -endif() - - - ## ## Detection of the requested version ## @@ -161,8 +151,12 @@ ## if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "hg") + if (NOT STATIC_BUILD AND NOT ALLOW_DOWNLOADS) + message(FATAL_ERROR "CMake is not allowed to download from Internet. Please set the ALLOW_DOWNLOADS option to ON") + endif() + set(ORTHANC_ROOT ${CMAKE_BINARY_DIR}/orthanc) - + if (NOT EXISTS ${ORTHANC_ROOT}) message("Forking the Orthanc source repository using Mercurial") @@ -216,6 +210,10 @@ set(ORTHANC_FRAMEWORK_ARCHIVE "${CMAKE_SOURCE_DIR}/ThirdPartyDownloads/${ORTHANC_FRAMEMORK_FILENAME}") if (NOT EXISTS "${ORTHANC_FRAMEWORK_ARCHIVE}") + if (NOT STATIC_BUILD AND NOT ALLOW_DOWNLOADS) + message(FATAL_ERROR "CMake is not allowed to download from Internet. Please set the ALLOW_DOWNLOADS option to ON") + endif() + message("Downloading: ${ORTHANC_FRAMEWORK_ARCHIVE}") file(DOWNLOAD