changeset 49:c06f1c00ce56

improved sdk download
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 30 Jul 2015 14:50:49 +0200
parents 1c776248a8eb
children 2578545f8d87
files CMakeLists.txt
diffstat 1 files changed, 11 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/CMakeLists.txt	Thu Jul 30 14:34:49 2015 +0200
+++ b/CMakeLists.txt	Thu Jul 30 14:50:49 2015 +0200
@@ -64,15 +64,18 @@
 
 # Check that the Orthanc SDK headers are available or download them
 if (STATIC_BUILD)
-  #set(ORTHANC_SDK_URL "http://orthanc.googlecode.com/hg")
-  set(ORTHANC_SDK_URL "http://orthanc.googlecode.com/hg-history/Orthanc-0.9.1")
+  #set(ORTHANC_SDK_URL "https://bitbucket.org/sjodogne/orthanc/raw/default")
+  set(ORTHANC_SDK_URL "https://bitbucket.org/sjodogne/orthanc/raw/Orthanc-0.9.1")
+
   file(MAKE_DIRECTORY ${AUTOGENERATED_DIR}/orthanc)
-  file(DOWNLOAD "${ORTHANC_SDK_URL}/Plugins/Include/orthanc/OrthancCPlugin.h"
-    "${AUTOGENERATED_DIR}/orthanc/OrthancCPlugin.h" SHOW_PROGRESS)
-  if (${MSVC})
-    add_definitions(-D_CRT_SECURE_NO_WARNINGS=1)
-    file(DOWNLOAD "${ORTHANC_SDK_URL}/Resources/ThirdParty/VisualStudio/stdint.h" 
-      "${AUTOGENERATED_DIR}/stdint.h" SHOW_PROGRESS)
+  file(DOWNLOAD 
+    "${ORTHANC_SDK_URL}/Plugins/Include/orthanc/OrthancCPlugin.h"
+    "${AUTOGENERATED_DIR}/orthanc/OrthancCPlugin.h" 
+    STATUS StatusTmp)
+
+  list(GET StatusTmp 0 Status)
+  if(NOT Status EQUAL 0)
+    message(FATAL_ERROR "Cannot download the plugin SDK")
   endif()
 else ()
   CHECK_INCLUDE_FILE_CXX(orthanc/OrthancCPlugin.h HAVE_ORTHANC_H)