changeset 2534:373d75b90d3b

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 17 Apr 2018 11:42:01 +0200
parents e7f86a9f0f79
children d3476d90dcb7
files Resources/DownloadOrthancFramework.cmake
diffstat 1 files changed, 9 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/Resources/DownloadOrthancFramework.cmake	Tue Apr 17 11:27:51 2018 +0200
+++ b/Resources/DownloadOrthancFramework.cmake	Tue Apr 17 11:42:01 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