diff Resources/DownloadOrthancFramework.cmake @ 2537:a1a331884ebc

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 17 Apr 2018 14:32:18 +0200
parents 373d75b90d3b
children 8b6b0b6ece6b
line wrap: on
line diff
--- a/Resources/DownloadOrthancFramework.cmake	Tue Apr 17 14:23:25 2018 +0200
+++ b/Resources/DownloadOrthancFramework.cmake	Tue Apr 17 14:32:18 2018 +0200
@@ -157,18 +157,24 @@
 
   set(ORTHANC_ROOT ${CMAKE_BINARY_DIR}/orthanc)
 
-  if (NOT EXISTS ${ORTHANC_ROOT})
+  if (EXISTS ${ORTHANC_ROOT})
+    message("Updating the Orthanc source repository using Mercurial")
+    execute_process(
+      COMMAND ${ORTHANC_FRAMEWORK_HG} pull
+      WORKING_DIRECTORY ${ORTHANC_ROOT}
+      RESULT_VARIABLE Failure
+      )    
+  else()
     message("Forking the Orthanc source repository using Mercurial")
-
     execute_process(
       COMMAND ${ORTHANC_FRAMEWORK_HG} clone "https://bitbucket.org/sjodogne/orthanc"
       WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
       RESULT_VARIABLE Failure
-      )
-    
-    if (Failure OR NOT EXISTS ${ORTHANC_ROOT})
-      message(FATAL_ERROR "Cannot fork the Orthanc repository")
-    endif()
+      )    
+  endif()
+
+  if (Failure OR NOT EXISTS ${ORTHANC_ROOT})
+    message(FATAL_ERROR "Cannot fork the Orthanc repository")
   endif()
 
   message("Setting branch of the Orthanc repository to: ${ORTHANC_FRAMEWORK_BRANCH}")