# HG changeset patch # User Sebastien Jodogne # Date 1438260633 -7200 # Node ID 38b8d0ce4e17080513925d24d5d9d2cf72c8e939 # Parent 829b5196a66214314ac56be04e4afe22711cd5d8 improved sdk download diff -r 829b5196a662 -r 38b8d0ce4e17 CMakeLists.txt --- a/CMakeLists.txt Thu Jul 30 14:34:31 2015 +0200 +++ b/CMakeLists.txt Thu Jul 30 14:50:33 2015 +0200 @@ -57,20 +57,27 @@ # 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) - file(DOWNLOAD "${ORTHANC_SDK_URL}/Plugins/Include/orthanc/OrthancCDatabasePlugin.h" - "${AUTOGENERATED_DIR}/orthanc/OrthancCDatabasePlugin.h" SHOW_PROGRESS) - file(DOWNLOAD "${ORTHANC_SDK_URL}/Plugins/Include/orthanc/OrthancCppDatabasePlugin.h" - "${AUTOGENERATED_DIR}/orthanc/OrthancCppDatabasePlugin.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() + + file(DOWNLOAD + "${ORTHANC_SDK_URL}/Plugins/Include/orthanc/OrthancCDatabasePlugin.h" + "${AUTOGENERATED_DIR}/orthanc/OrthancCDatabasePlugin.h") + + file(DOWNLOAD + "${ORTHANC_SDK_URL}/Plugins/Include/orthanc/OrthancCppDatabasePlugin.h" + "${AUTOGENERATED_DIR}/orthanc/OrthancCppDatabasePlugin.h") else () CHECK_INCLUDE_FILE_CXX(orthanc/OrthancCppDatabasePlugin.h HAVE_ORTHANC_H) if (NOT HAVE_ORTHANC_H)