changeset 109:045e251f9c4d

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 08 Nov 2016 10:07:23 +0100
parents 590958f541cb
children 22f3170c2791
files CMakeLists.txt Orthanc/Resources/CMake/DownloadPackage.cmake
diffstat 2 files changed, 12 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/CMakeLists.txt	Tue Nov 08 09:58:20 2016 +0100
+++ b/CMakeLists.txt	Tue Nov 08 10:07:23 2016 +0100
@@ -40,6 +40,7 @@
 mark_as_advanced(USE_GTEST_DEBIAN_SOURCE_PACKAGE)
 
 set(ORTHANC_ROOT ${CMAKE_SOURCE_DIR}/Orthanc)
+set(ORTHANC_DISABLE_PATCH ON)  # No need for the "patch" command-line tool
 include(CheckIncludeFiles)
 include(CheckIncludeFileCXX)
 include(CheckLibraryExists)
--- a/Orthanc/Resources/CMake/DownloadPackage.cmake	Tue Nov 08 09:58:20 2016 +0100
+++ b/Orthanc/Resources/CMake/DownloadPackage.cmake	Tue Nov 08 10:07:23 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()