changeset 553:27d32fc6209a

simplifications to cmake, use a digest of boost 1.54.0 thanks bcp
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 17 Sep 2013 15:06:16 +0200
parents 938d8461cf8f
children 2681bcc1eb37
files Resources/CMake/BoostConfiguration.cmake Resources/CMake/BoostConfiguration.sh Resources/CMake/DcmtkConfiguration.cmake Resources/CMake/DownloadPackage.cmake Resources/CMake/GoogleLogConfiguration.cmake Resources/CMake/GoogleTestConfiguration.cmake Resources/CMake/JsonCppConfiguration.cmake Resources/CMake/LibCurlConfiguration.cmake Resources/CMake/LibPngConfiguration.cmake Resources/CMake/LuaConfiguration.cmake Resources/CMake/MongooseConfiguration.cmake Resources/CMake/OpenSslConfiguration.cmake Resources/CMake/SQLiteConfiguration.cmake Resources/CMake/ZlibConfiguration.cmake
diffstat 14 files changed, 59 insertions(+), 63 deletions(-) [+]
line wrap: on
line diff
--- a/Resources/CMake/BoostConfiguration.cmake	Tue Sep 17 14:20:48 2013 +0200
+++ b/Resources/CMake/BoostConfiguration.cmake	Tue Sep 17 15:06:16 2013 +0200
@@ -41,16 +41,14 @@
 if (BOOST_STATIC)
   # Parameters for Boost 1.54.0
   SET(BOOST_NAME boost_1_54_0)
-  SET(BOOST_MD5 "78a35834c45220a6164310e280abe675")
+  SET(BOOST_MD5 "a1dd0265c5ba500daa90eb8d01aac335")
   SET(BOOST_FILESYSTEM_SOURCES_DIR "${BOOST_NAME}/libs/filesystem/src")
   
   SET(BOOST_SOURCES_DIR ${CMAKE_BINARY_DIR}/${BOOST_NAME})
   DownloadPackage(
     "${BOOST_MD5}"
-    "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/${BOOST_NAME}.zip"
-    "${BOOST_SOURCES_DIR}" "${BOOST_PRELOADED}" 
-    # Only uncompress the Boost modules we need
-    "${BOOST_NAME}/boost/* ${BOOST_NAME}/libs/thread/src/* ${BOOST_NAME}/libs/system/src/* ${BOOST_NAME}/libs/locale/src/* ${BOOST_NAME}/libs/date_time/src/* ${BOOST_FILESYSTEM_SOURCES_DIR}/*"
+    "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/${BOOST_NAME}_bcpdigest.tar.gz"
+    "${BOOST_SOURCES_DIR}"
     )
 
   set(BOOST_SOURCES)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Resources/CMake/BoostConfiguration.sh	Tue Sep 17 15:06:16 2013 +0200
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+set -e
+set -u
+
+## Starting with version 0.6.2, Orthanc is shipped with a subset of the
+## Boost libraries that is generated with the BCP tool:
+##
+## http://www.boost.org/doc/libs/1_54_0/tools/bcp/doc/html/index.html
+##
+## This script generates this subset.
+
+rm -rf /tmp/boost_1_54_0
+rm -rf /tmp/bcp/boost_1_54_0
+
+cd /tmp
+echo "Uncompressing the source of Boost 1.54.0..."
+tar xfz boost_1_54_0.tar.gz 
+
+echo "Generating the subset..."
+mkdir -p /tmp/bcp/boost_1_54_0
+bcp --boost=/tmp/boost_1_54_0 thread system locale date_time filesystem math/special_functions /tmp/bcp/boost_1_54_0
+cd /tmp/bcp
+
+echo "Compressing the subset..."
+tar cfz boost_1_54_0_bcpdigest.tar.gz boost_1_54_0
+ls -l boost_1_54_0_bcpdigest.tar.gz
+md5sum boost_1_54_0_bcpdigest.tar.gz
--- a/Resources/CMake/DcmtkConfiguration.cmake	Tue Sep 17 14:20:48 2013 +0200
+++ b/Resources/CMake/DcmtkConfiguration.cmake	Tue Sep 17 15:06:16 2013 +0200
@@ -6,7 +6,7 @@
   DownloadPackage(
     "219ad631b82031806147e4abbfba4fa4"
     "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/dcmtk-3.6.0.zip" 
-    "${DCMTK_SOURCES_DIR}" "" "")
+    "${DCMTK_SOURCES_DIR}")
 
   IF(CMAKE_CROSSCOMPILING)
     SET(C_CHAR_UNSIGNED 1 CACHE INTERNAL "Whether char is unsigned.")
--- a/Resources/CMake/DownloadPackage.cmake	Tue Sep 17 14:20:48 2013 +0200
+++ b/Resources/CMake/DownloadPackage.cmake	Tue Sep 17 15:06:16 2013 +0200
@@ -10,20 +10,16 @@
 endmacro()
 
 
-macro(DownloadPackage MD5 Url TargetDirectory PreloadedVariable UncompressArguments)
+macro(DownloadPackage MD5 Url TargetDirectory)
   if (NOT IS_DIRECTORY "${TargetDirectory}")
     GetUrlFilename(TMP_FILENAME "${Url}")
-    if ("${PreloadedVariable}" STREQUAL "")
-      set(TMP_PATH "${CMAKE_SOURCE_DIR}/ThirdPartyDownloads/${TMP_FILENAME}")
-      if (NOT EXISTS "${TMP_PATH}")
-        message("Downloading ${Url}")
-        file(DOWNLOAD "${Url}" "${TMP_PATH}" SHOW_PROGRESS EXPECTED_MD5 "${MD5}")
-      else()
-        message("Using local copy of ${Url}")
-      endif()
+
+    set(TMP_PATH "${CMAKE_SOURCE_DIR}/ThirdPartyDownloads/${TMP_FILENAME}")
+    if (NOT EXISTS "${TMP_PATH}")
+      message("Downloading ${Url}")
+      file(DOWNLOAD "${Url}" "${TMP_PATH}" SHOW_PROGRESS EXPECTED_MD5 "${MD5}")
     else()
-      message("Using preloaded archive ${PreloadedVariable} for ${Url}")
-      set(TMP_PATH "${PreloadedVariable}")
+      message("Using local copy of ${Url}")
     endif()
 
     GetUrlExtension(TMP_EXTENSION "${Url}")
@@ -48,37 +44,18 @@
           message(FATAL_ERROR "Error while running the uncompression tool")
         endif()
 
-        set(ARGS ${UncompressArguments})
-        SEPARATE_ARGUMENTS(ARGS)
-        list(LENGTH ARGS TMP_LENGTH)
-
         if ("${TMP_EXTENSION}" STREQUAL "tgz")
           string(REGEX REPLACE ".tgz$" ".tar" TMP_FILENAME2 "${TMP_FILENAME}")
         else()
           string(REGEX REPLACE ".gz$" "" TMP_FILENAME2 "${TMP_FILENAME}")
         endif()
 
-        if (TMP_LENGTH EQUAL 0)
-          execute_process(
-            COMMAND ${ZIP_EXECUTABLE} x -y ${TMP_FILENAME2}
-            WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
-            RESULT_VARIABLE Failure
-            OUTPUT_QUIET
-            )
-        else()
-          foreach(SUBDIR ${ARGS})
-            execute_process(
-              COMMAND ${ZIP_EXECUTABLE} x -y "-i!${SUBDIR}" "${TMP_FILENAME2}"
-              WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
-              RESULT_VARIABLE Failure
-              OUTPUT_QUIET
-              )
-
-            if (Failure)
-              message(FATAL_ERROR "Error while running the uncompression tool")
-            endif()
-          endforeach()
-        endif()
+        execute_process(
+          COMMAND ${ZIP_EXECUTABLE} x -y ${TMP_FILENAME2}
+          WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+          RESULT_VARIABLE Failure
+          OUTPUT_QUIET
+          )
       elseif ("${TMP_EXTENSION}" STREQUAL "zip")
         execute_process(
           COMMAND ${ZIP_EXECUTABLE} x -y ${TMP_PATH}
@@ -93,20 +70,20 @@
     else()
       if ("${TMP_EXTENSION}" STREQUAL "zip")
         execute_process(
-          COMMAND sh -c "unzip -q ${TMP_PATH} ${UncompressArguments}"
+          COMMAND sh -c "unzip -q ${TMP_PATH}"
           WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
           RESULT_VARIABLE Failure
         )
       elseif (("${TMP_EXTENSION}" STREQUAL "gz") OR ("${TMP_EXTENSION}" STREQUAL "tgz"))
-        #message("tar xvfz ${TMP_PATH} ${UncompressArguments}")
+        #message("tar xvfz ${TMP_PATH}")
         execute_process(
-          COMMAND sh -c "tar xfz ${TMP_PATH} ${UncompressArguments}"
+          COMMAND sh -c "tar xfz ${TMP_PATH}"
           WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
           RESULT_VARIABLE Failure
           )
       elseif ("${TMP_EXTENSION}" STREQUAL "bz2")
         execute_process(
-          COMMAND sh -c "tar xfj ${TMP_PATH} ${UncompressArguments}"
+          COMMAND sh -c "tar xfj ${TMP_PATH}"
           WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
           RESULT_VARIABLE Failure
           )
@@ -124,4 +101,3 @@
     endif()
   endif()
 endmacro()
-
--- a/Resources/CMake/GoogleLogConfiguration.cmake	Tue Sep 17 14:20:48 2013 +0200
+++ b/Resources/CMake/GoogleLogConfiguration.cmake	Tue Sep 17 15:06:16 2013 +0200
@@ -3,13 +3,7 @@
   DownloadPackage(
     "897fbff90d91ea2b6d6e78c8cea641cc"
     "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/glog-0.3.2.tar.gz"
-    "${GOOGLE_LOG_SOURCES_DIR}" "" "")
-
-  #SET(GOOGLE_LOG_SOURCES_DIR ${CMAKE_BINARY_DIR}/glog-0.3.3)
-  #DownloadPackage(
-  #  "a6fd2c22f8996846e34c763422717c18"
-  #  "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/glog-0.3.3.tar.gz"
-  #  "${GOOGLE_LOG_SOURCES_DIR}" "" "")
+    "${GOOGLE_LOG_SOURCES_DIR}")
 
   set(GOOGLE_LOG_HEADERS
     ${GOOGLE_LOG_SOURCES_DIR}/src/glog/logging.h
--- a/Resources/CMake/GoogleTestConfiguration.cmake	Tue Sep 17 14:20:48 2013 +0200
+++ b/Resources/CMake/GoogleTestConfiguration.cmake	Tue Sep 17 15:06:16 2013 +0200
@@ -12,7 +12,7 @@
   DownloadPackage(
     "4577b49f2973c90bf9ba69aa8166b786"
     "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/gtest-1.6.0.zip"
-    "${GTEST_SOURCES_DIR}" "" "")
+    "${GTEST_SOURCES_DIR}")
 
   include_directories(
     ${GTEST_SOURCES_DIR}/include
--- a/Resources/CMake/JsonCppConfiguration.cmake	Tue Sep 17 14:20:48 2013 +0200
+++ b/Resources/CMake/JsonCppConfiguration.cmake	Tue Sep 17 15:06:16 2013 +0200
@@ -12,7 +12,7 @@
   DownloadPackage(
     "363e2f4cbd3aeb63bf4e571f377400fb"
     "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/jsoncpp-src-0.6.0-rc2.tar.gz"
-    "${JSONCPP_SOURCES_DIR}" "" "")
+    "${JSONCPP_SOURCES_DIR}")
 
   list(APPEND THIRD_PARTY_SOURCES
     ${JSONCPP_SOURCES_DIR}/src/lib_json/json_reader.cpp
--- a/Resources/CMake/LibCurlConfiguration.cmake	Tue Sep 17 14:20:48 2013 +0200
+++ b/Resources/CMake/LibCurlConfiguration.cmake	Tue Sep 17 15:06:16 2013 +0200
@@ -3,7 +3,7 @@
   DownloadPackage(
     "3fa4d5236f2a36ca5c3af6715e837691"
     "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/curl-7.26.0.tar.gz"
-    "${CURL_SOURCES_DIR}" "" "")
+    "${CURL_SOURCES_DIR}")
 
   include_directories(${CURL_SOURCES_DIR}/include)
   AUX_SOURCE_DIRECTORY(${CURL_SOURCES_DIR}/lib CURL_SOURCES)
--- a/Resources/CMake/LibPngConfiguration.cmake	Tue Sep 17 14:20:48 2013 +0200
+++ b/Resources/CMake/LibPngConfiguration.cmake	Tue Sep 17 15:06:16 2013 +0200
@@ -3,7 +3,7 @@
   DownloadPackage(
     "8ea7f60347a306c5faf70b977fa80e28"
     "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/libpng-1.5.12.tar.gz"
-    "${LIBPNG_SOURCES_DIR}" "${LIBPNG_PRELOADED}" "")
+    "${LIBPNG_SOURCES_DIR}")
 
   include_directories(
     ${LIBPNG_SOURCES_DIR}
--- a/Resources/CMake/LuaConfiguration.cmake	Tue Sep 17 14:20:48 2013 +0200
+++ b/Resources/CMake/LuaConfiguration.cmake	Tue Sep 17 15:06:16 2013 +0200
@@ -3,7 +3,7 @@
   DownloadPackage(
     "2e115fe26e435e33b0d5c022e4490567"
     "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/lua-5.1.5.tar.gz"
-    "${LUA_SOURCES_DIR}" "" "")
+    "${LUA_SOURCES_DIR}")
 
   add_definitions(
     #-DLUA_LIB=1
--- a/Resources/CMake/MongooseConfiguration.cmake	Tue Sep 17 14:20:48 2013 +0200
+++ b/Resources/CMake/MongooseConfiguration.cmake	Tue Sep 17 15:06:16 2013 +0200
@@ -3,7 +3,7 @@
   DownloadPackage(
     "e718fc287b4eb1bd523be3fa00942bb0"
     "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/mongoose-3.1.tgz"
-    "${MONGOOSE_SOURCES_DIR}" "" "")
+    "${MONGOOSE_SOURCES_DIR}")
 
   # Patch mongoose
   execute_process(
--- a/Resources/CMake/OpenSslConfiguration.cmake	Tue Sep 17 14:20:48 2013 +0200
+++ b/Resources/CMake/OpenSslConfiguration.cmake	Tue Sep 17 15:06:16 2013 +0200
@@ -3,7 +3,7 @@
   DownloadPackage(
     "ae412727c8c15b67880aef7bd2999b2e"
     "www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/openssl-1.0.1c.tar.gz"
-    "${OPENSSL_SOURCES_DIR}" "" "")
+    "${OPENSSL_SOURCES_DIR}")
 
   if (NOT EXISTS "${OPENSSL_SOURCES_DIR}/include/PATCHED")
     if ("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows")
--- a/Resources/CMake/SQLiteConfiguration.cmake	Tue Sep 17 14:20:48 2013 +0200
+++ b/Resources/CMake/SQLiteConfiguration.cmake	Tue Sep 17 15:06:16 2013 +0200
@@ -3,7 +3,7 @@
   DownloadPackage(
     "5fbeff9645ab035a1f580e90b279a16d"
     "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/sqlite-amalgamation-3071300.zip"
-    "${SQLITE_SOURCES_DIR}" "" "")
+    "${SQLITE_SOURCES_DIR}")
 
   list(APPEND THIRD_PARTY_SOURCES
     ${SQLITE_SOURCES_DIR}/sqlite3.c
--- a/Resources/CMake/ZlibConfiguration.cmake	Tue Sep 17 14:20:48 2013 +0200
+++ b/Resources/CMake/ZlibConfiguration.cmake	Tue Sep 17 15:06:16 2013 +0200
@@ -9,7 +9,7 @@
   DownloadPackage(
     "60df6a37c56e7c1366cca812414f7b85"
     "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/zlib-1.2.7.tar.gz"
-    "${ZLIB_SOURCES_DIR}" "${ZLIB_PRELOADED}" "")
+    "${ZLIB_SOURCES_DIR}")
 
   include_directories(
     ${ZLIB_SOURCES_DIR}