changeset 2130:72cb107a7346

option ORTHANC_DISABLE_PATCH
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 08 Nov 2016 10:06:16 +0100
parents 0c09d1af22f3
children bb199bccdc45
files Resources/CMake/DownloadPackage.cmake
diffstat 1 files changed, 11 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/Resources/CMake/DownloadPackage.cmake	Mon Nov 07 17:44:10 2016 +0100
+++ b/Resources/CMake/DownloadPackage.cmake	Tue Nov 08 10:06:16 2016 +0100
@@ -15,16 +15,18 @@
 ## Setup the patch command-line tool
 ##
 
-if ("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows")
-  set(PATCH_EXECUTABLE ${CMAKE_CURRENT_LIST_DIR}/../ThirdParty/patch/patch.exe)
-  if (NOT EXISTS ${PATCH_EXECUTABLE})
-    message(FATAL_ERROR "Unable to find the patch.exe tool that is shipped with Orthanc")
-  endif()
+if (NOT ORTHANC_DISABLE_PATCH)
+  if ("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows")
+    set(PATCH_EXECUTABLE ${CMAKE_CURRENT_LIST_DIR}/../ThirdParty/patch/patch.exe)
+    if (NOT EXISTS ${PATCH_EXECUTABLE})
+      message(FATAL_ERROR "Unable to find the patch.exe tool that is shipped with Orthanc")
+    endif()
 
-else ()
-  find_program(PATCH_EXECUTABLE patch)
-  if (${PATCH_EXECUTABLE} MATCHES "PATCH_EXECUTABLE-NOTFOUND")
-    message(FATAL_ERROR "Please install the 'patch' standard command-line tool")
+  else ()
+    find_program(PATCH_EXECUTABLE patch)
+    if (${PATCH_EXECUTABLE} MATCHES "PATCH_EXECUTABLE-NOTFOUND")
+      message(FATAL_ERROR "Please install the 'patch' standard command-line tool")
+    endif()
   endif()
 endif()