# HG changeset patch # User Sebastien Jodogne # Date 1438260649 -7200 # Node ID c06f1c00ce56119409ed414847d6b63e3358cd22 # Parent 1c776248a8eba9165b9a4a74f9df33f6b6afea99 improved sdk download diff -r 1c776248a8eb -r c06f1c00ce56 CMakeLists.txt --- 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)