changeset 32:5d9cfb2c149f

improved sdk download
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 30 Jul 2015 14:53:47 +0200
parents ad94300dde64
children d6904d8d165a
files CMakeLists.txt
diffstat 1 files changed, 12 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/CMakeLists.txt	Wed Jul 29 10:37:04 2015 +0200
+++ b/CMakeLists.txt	Thu Jul 30 14:53:47 2015 +0200
@@ -54,18 +54,21 @@
 
 # Check that the Orthanc SDK headers are available or download them
 set(AUTOGENERATED_DIR ${CMAKE_CURRENT_BINARY_DIR}/AUTOGENERATED)
+
 if (STATIC_BUILD)
-  set(ORTHANC_SDK_URL "http://orthanc.googlecode.com/hg")
-  #set(ORTHANC_SDK_URL "http://orthanc.googlecode.com/hg-history/Orthanc-0.8.6")
+  #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()
-  include_directories(${AUTOGENERATED_DIR})
 else ()
   CHECK_INCLUDE_FILE_CXX(orthanc/OrthancCPlugin.h HAVE_ORTHANC_H)
   if (NOT HAVE_ORTHANC_H)