changeset 28:d158e4ca5734

sync with mainline
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 04 Jun 2015 09:54:10 +0200
parents c05ce507d8ae
children 4cfad290b808
files Orthanc/Resources/CMake/BoostConfiguration.cmake Orthanc/Resources/CMake/Compiler.cmake Orthanc/Resources/CMake/JsonCppConfiguration.cmake Orthanc/Resources/CMake/LibPngConfiguration.cmake Orthanc/Resources/CMake/SQLiteConfiguration.cmake Orthanc/Resources/CMake/ZlibConfiguration.cmake
diffstat 6 files changed, 17 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/Orthanc/Resources/CMake/BoostConfiguration.cmake	Tue Jun 02 12:27:59 2015 +0200
+++ b/Orthanc/Resources/CMake/BoostConfiguration.cmake	Thu Jun 04 09:54:10 2015 +0200
@@ -122,8 +122,6 @@
     ${BOOST_SOURCES_DIR}/libs/system/src/error_code.cpp
     )
 
-  list(APPEND THIRD_PARTY_SOURCES ${BOOST_SOURCES})
-
   add_definitions(
     # Static build of Boost
     -DBOOST_ALL_NO_LIB 
@@ -138,7 +136,7 @@
     -DBOOST_HAS_FILESYSTEM_V3=1
     )
 
-  if (${CMAKE_COMPILER_IS_GNUCXX})
+  if (CMAKE_COMPILER_IS_GNUCXX)
     add_definitions(-isystem ${BOOST_SOURCES_DIR})
   endif()
 
--- a/Orthanc/Resources/CMake/Compiler.cmake	Tue Jun 02 12:27:59 2015 +0200
+++ b/Orthanc/Resources/CMake/Compiler.cmake	Thu Jun 04 09:54:10 2015 +0200
@@ -1,6 +1,12 @@
 # This file sets all the compiler-related flags
 
-if (${CMAKE_COMPILER_IS_GNUCXX})
+if (CMAKE_CROSSCOMPILING)
+  # Cross-compilation necessarily implies standalone and static build
+  SET(STATIC_BUILD ON)
+  SET(STANDALONE_BUILD ON)
+endif()
+
+if (CMAKE_COMPILER_IS_GNUCXX)
   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-long-long -Wno-implicit-function-declaration")  
   # --std=c99 makes libcurl not to compile
   # -pedantic gives a lot of warnings on OpenSSL 
@@ -11,7 +17,7 @@
     set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff -I<CMAKE_CURRENT_SOURCE_DIR> <SOURCE> <OBJECT>")
   endif()
 
-elseif (${MSVC})
+elseif (MSVC)
   # Use static runtime under Visual Studio
   # http://www.cmake.org/Wiki/CMake_FAQ#Dynamic_Replace
   # http://stackoverflow.com/a/6510446
@@ -53,6 +59,8 @@
 
   if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
     set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed")
+    set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--as-needed")
+    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--as-needed")
     add_definitions(
       -D_LARGEFILE64_SOURCE=1 
       -D_FILE_OFFSET_BITS=64
@@ -67,7 +75,7 @@
     )
   link_libraries(rpcrt4 ws2_32)
 
-  if (${CMAKE_COMPILER_IS_GNUCXX})
+  if (CMAKE_COMPILER_IS_GNUCXX)
     # This is a patch for MinGW64
     SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--allow-multiple-definition -static-libgcc -static-libstdc++")
 
@@ -118,7 +126,7 @@
 endif()
 
 
-if (${STATIC_BUILD})
+if (STATIC_BUILD)
   add_definitions(-DORTHANC_STATIC=1)
 else()
   add_definitions(-DORTHANC_STATIC=0)
--- a/Orthanc/Resources/CMake/JsonCppConfiguration.cmake	Tue Jun 02 12:27:59 2015 +0200
+++ b/Orthanc/Resources/CMake/JsonCppConfiguration.cmake	Thu Jun 04 09:54:10 2015 +0200
@@ -5,7 +5,7 @@
     "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/jsoncpp-src-0.6.0-rc2.tar.gz"
     "${JSONCPP_SOURCES_DIR}")
 
-  list(APPEND THIRD_PARTY_SOURCES
+  set(JSONCPP_SOURCES
     ${JSONCPP_SOURCES_DIR}/src/lib_json/json_reader.cpp
     ${JSONCPP_SOURCES_DIR}/src/lib_json/json_value.cpp
     ${JSONCPP_SOURCES_DIR}/src/lib_json/json_writer.cpp
--- a/Orthanc/Resources/CMake/LibPngConfiguration.cmake	Tue Jun 02 12:27:59 2015 +0200
+++ b/Orthanc/Resources/CMake/LibPngConfiguration.cmake	Thu Jun 04 09:54:10 2015 +0200
@@ -38,8 +38,6 @@
   #  SOURCE ${LIBPNG_SOURCES}
   #  PROPERTY COMPILE_FLAGS -UHAVE_CONFIG_H)
 
-  list(APPEND THIRD_PARTY_SOURCES ${LIBPNG_SOURCES})
-
   add_definitions(
     -DPNG_NO_CONSOLE_IO=1
     -DPNG_NO_STDIO=1
--- a/Orthanc/Resources/CMake/SQLiteConfiguration.cmake	Tue Jun 02 12:27:59 2015 +0200
+++ b/Orthanc/Resources/CMake/SQLiteConfiguration.cmake	Thu Jun 04 09:54:10 2015 +0200
@@ -5,7 +5,7 @@
     "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/sqlite-amalgamation-3071300.zip"
     "${SQLITE_SOURCES_DIR}")
 
-  list(APPEND THIRD_PARTY_SOURCES
+  set(SQLITE_SOURCES
     ${SQLITE_SOURCES_DIR}/sqlite3.c
     )
 
--- a/Orthanc/Resources/CMake/ZlibConfiguration.cmake	Tue Jun 02 12:27:59 2015 +0200
+++ b/Orthanc/Resources/CMake/ZlibConfiguration.cmake	Thu Jun 04 09:54:10 2015 +0200
@@ -1,5 +1,5 @@
 # This is the minizip distribution to create ZIP files
-list(APPEND THIRD_PARTY_SOURCES 
+set(ZLIB_SOURCES
   ${ORTHANC_ROOT}/Resources/ThirdParty/minizip/ioapi.c
   ${ORTHANC_ROOT}/Resources/ThirdParty/minizip/zip.c
   )
@@ -15,7 +15,7 @@
     ${ZLIB_SOURCES_DIR}
     )
 
-  list(APPEND THIRD_PARTY_SOURCES 
+  list(APPEND ZLIB_SOURCES 
     ${ZLIB_SOURCES_DIR}/adler32.c
     ${ZLIB_SOURCES_DIR}/compress.c
     ${ZLIB_SOURCES_DIR}/crc32.c