changeset 672:670dd1f2edab

improvements to cmake
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 19 Nov 2013 15:57:28 +0100
parents 7131193b0e4b
children 9a8716686f18
files CMakeLists.txt Resources/CMake/OpenSslConfiguration.cmake Resources/CMake/ZlibConfiguration.cmake
diffstat 3 files changed, 17 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/CMakeLists.txt	Fri Nov 08 16:28:58 2013 +0100
+++ b/CMakeLists.txt	Tue Nov 19 15:57:28 2013 +0100
@@ -29,6 +29,8 @@
 SET(USE_SYSTEM_BOOST ON CACHE BOOL "Use the system version of Boost")
 SET(USE_SYSTEM_LIBPNG ON CACHE BOOL "Use the system version of LibPng")
 SET(USE_SYSTEM_CURL ON CACHE BOOL "Use the system version of LibCurl")
+SET(USE_SYSTEM_OPENSSL ON CACHE BOOL "Use the system version of OpenSSL")
+SET(USE_SYSTEM_ZLIB ON CACHE BOOL "Use the system version of ZLib")
 
 # Distribution-specific settings
 SET(USE_GTEST_DEBIAN_SOURCE_PACKAGE OFF CACHE BOOL "Use the sources of Google Test shipped with libgtest-dev (Debian only)")
@@ -64,6 +66,16 @@
   )
 
 include(${CMAKE_SOURCE_DIR}/Resources/CMake/GoogleLogConfiguration.cmake)
+include(${CMAKE_SOURCE_DIR}/Resources/CMake/BoostConfiguration.cmake)
+include(${CMAKE_SOURCE_DIR}/Resources/CMake/DcmtkConfiguration.cmake)
+include(${CMAKE_SOURCE_DIR}/Resources/CMake/MongooseConfiguration.cmake)
+include(${CMAKE_SOURCE_DIR}/Resources/CMake/ZlibConfiguration.cmake)
+include(${CMAKE_SOURCE_DIR}/Resources/CMake/SQLiteConfiguration.cmake)
+include(${CMAKE_SOURCE_DIR}/Resources/CMake/JsonCppConfiguration.cmake)
+include(${CMAKE_SOURCE_DIR}/Resources/CMake/LibPngConfiguration.cmake)
+include(${CMAKE_SOURCE_DIR}/Resources/CMake/LuaConfiguration.cmake)
+include(${CMAKE_SOURCE_DIR}/Resources/CMake/LibCurlConfiguration.cmake)
+
 
 if (${ENABLE_SSL})
   add_definitions(-DORTHANC_SSL_ENABLED=1)
@@ -72,16 +84,6 @@
   add_definitions(-DORTHANC_SSL_ENABLED=0)
 endif()
 
-include(${CMAKE_SOURCE_DIR}/Resources/CMake/BoostConfiguration.cmake)
-include(${CMAKE_SOURCE_DIR}/Resources/CMake/DcmtkConfiguration.cmake)
-include(${CMAKE_SOURCE_DIR}/Resources/CMake/MongooseConfiguration.cmake)
-include(${CMAKE_SOURCE_DIR}/Resources/CMake/ZlibConfiguration.cmake)
-include(${CMAKE_SOURCE_DIR}/Resources/CMake/SQLiteConfiguration.cmake)
-include(${CMAKE_SOURCE_DIR}/Resources/CMake/JsonCppConfiguration.cmake)
-include(${CMAKE_SOURCE_DIR}/Resources/CMake/LibCurlConfiguration.cmake)
-include(${CMAKE_SOURCE_DIR}/Resources/CMake/LibPngConfiguration.cmake)
-include(${CMAKE_SOURCE_DIR}/Resources/CMake/LuaConfiguration.cmake)
-
 
 
 #####################################################################
--- a/Resources/CMake/OpenSslConfiguration.cmake	Fri Nov 08 16:28:58 2013 +0100
+++ b/Resources/CMake/OpenSslConfiguration.cmake	Tue Nov 19 15:57:28 2013 +0100
@@ -1,4 +1,4 @@
-if (STATIC_BUILD)
+if (STATIC_BUILD OR NOT USE_SYSTEM_OPENSSL)
   SET(OPENSSL_SOURCES_DIR ${CMAKE_BINARY_DIR}/openssl-1.0.1c)
   DownloadPackage(
     "ae412727c8c15b67880aef7bd2999b2e"
@@ -180,18 +180,18 @@
     ${OPENSSL_SOURCES_DIR}/crypto/des/ncbc_enc.c
     )
 
-  #if (${MSVC})
-  if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
+  if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
     set_source_files_properties(
       ${OPENSSL_SOURCES}
       PROPERTIES COMPILE_DEFINITIONS
       "OPENSSL_SYSNAME_WIN32;SO_WIN32;WIN32_LEAN_AND_MEAN;L_ENDIAN")
 
-  elseif (${CMAKE_SYSTEM_VERSION} STREQUAL "LinuxStandardBase")
+  elseif ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase")
     execute_process(
       COMMAND patch ui_openssl.c ${CMAKE_SOURCE_DIR}/Resources/Patches/openssl-lsb.diff
       WORKING_DIRECTORY ${OPENSSL_SOURCES_DIR}/crypto/ui
       )
+
   endif()
 
   #add_library(OpenSSL STATIC ${OPENSSL_SOURCES})
--- a/Resources/CMake/ZlibConfiguration.cmake	Fri Nov 08 16:28:58 2013 +0100
+++ b/Resources/CMake/ZlibConfiguration.cmake	Tue Nov 19 15:57:28 2013 +0100
@@ -4,7 +4,7 @@
   ${ORTHANC_ROOT}/Resources/minizip/zip.c
   )
 
-if (${STATIC_BUILD})
+if (STATIC_BUILD OR NOT USE_SYSTEM_ZLIB)
   SET(ZLIB_SOURCES_DIR ${CMAKE_BINARY_DIR}/zlib-1.2.7)
   DownloadPackage(
     "60df6a37c56e7c1366cca812414f7b85"