Mercurial > hg > orthanc
changeset 1414:0a67a502c90f
fixes
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 03 Jun 2015 21:14:05 +0200 |
parents | 98fa856b4f8f |
children | 728c22ade2e2 |
files | CMakeLists.txt Resources/CMake/BoostConfiguration.cmake Resources/CMake/Compiler.cmake Resources/CMake/DcmtkConfiguration.cmake Resources/CMake/JsonCppConfiguration.cmake Resources/CMake/LibPngConfiguration.cmake Resources/CMake/MongooseConfiguration.cmake Resources/CMake/PugixmlConfiguration.cmake Resources/CMake/SQLiteConfiguration.cmake Resources/CMake/ZlibConfiguration.cmake |
diffstat | 10 files changed, 34 insertions(+), 36 deletions(-) [+] |
line wrap: on
line diff
--- a/CMakeLists.txt Wed Jun 03 17:38:39 2015 +0200 +++ b/CMakeLists.txt Wed Jun 03 21:14:05 2015 +0200 @@ -223,18 +223,6 @@ ## Inclusion of third-party dependencies ##################################################################### -# Configuration of the standalone builds -if (CMAKE_CROSSCOMPILING) - # Cross-compilation implies the standalone build - SET(STANDALONE_BUILD ON) -endif() - -# Prepare the third-party dependencies -SET(THIRD_PARTY_SOURCES - ${CMAKE_SOURCE_DIR}/Resources/ThirdParty/md5/md5.c - ${CMAKE_SOURCE_DIR}/Resources/ThirdParty/base64/base64.cpp - ) - include(${CMAKE_SOURCE_DIR}/Resources/CMake/GoogleLogConfiguration.cmake) include(${CMAKE_SOURCE_DIR}/Resources/CMake/BoostConfiguration.cmake) include(${CMAKE_SOURCE_DIR}/Resources/CMake/DcmtkConfiguration.cmake) @@ -248,7 +236,7 @@ include(${CMAKE_SOURCE_DIR}/Resources/CMake/PugixmlConfiguration.cmake) -if (${ENABLE_SSL}) +if (ENABLE_SSL) add_definitions(-DORTHANC_SSL_ENABLED=1) include(${CMAKE_SOURCE_DIR}/Resources/CMake/OpenSslConfiguration.cmake) else() @@ -275,7 +263,7 @@ ## Autogeneration of files ##################################################################### -if (${STANDALONE_BUILD}) +if (STANDALONE_BUILD) # We embed all the resources in the binaries for standalone builds add_definitions(-DORTHANC_STANDALONE=1) EmbedResources( @@ -300,7 +288,7 @@ ##################################################################### # Setup precompiled headers for Microsoft Visual Studio -if (${MSVC}) +if (MSVC) add_definitions(-DORTHANC_USE_PRECOMPILED_HEADERS=1) ADD_VISUAL_STUDIO_PRECOMPILED_HEADERS( @@ -326,13 +314,24 @@ add_library(CoreLibrary STATIC + ${ORTHANC_CORE_SOURCES} ${AUTOGENERATED_SOURCES} - ${THIRD_PARTY_SOURCES} + ${CURL_SOURCES} - ${ORTHANC_CORE_SOURCES} + ${ZLIB_SOURCES} + ${MONGOOSE_SOURCES} + ${JSONCPP_SOURCES} + ${BOOST_SOURCES} + ${SQLITE_SOURCES} + ${LIBPNG_SOURCES} + ${PUGIXML_SOURCES} + + ${CMAKE_SOURCE_DIR}/Resources/ThirdParty/md5/md5.c + ${CMAKE_SOURCE_DIR}/Resources/ThirdParty/base64/base64.cpp ) + ##################################################################### ## Build the Orthanc server ##################################################################### @@ -398,7 +397,7 @@ add_library( ServeFolders SHARED Plugins/Samples/ServeFolders/Plugin.cpp - ${THIRD_PARTY_SOURCES} + ${JSONCPP_SOURCES} ) set_target_properties(
--- a/Resources/CMake/BoostConfiguration.cmake Wed Jun 03 17:38:39 2015 +0200 +++ b/Resources/CMake/BoostConfiguration.cmake Wed Jun 03 21:14:05 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
--- a/Resources/CMake/Compiler.cmake Wed Jun 03 17:38:39 2015 +0200 +++ b/Resources/CMake/Compiler.cmake Wed Jun 03 21:14:05 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 @@ -67,7 +73,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 +124,7 @@ endif() -if (${STATIC_BUILD}) +if (STATIC_BUILD) add_definitions(-DORTHANC_STATIC=1) else() add_definitions(-DORTHANC_STATIC=0)
--- a/Resources/CMake/DcmtkConfiguration.cmake Wed Jun 03 17:38:39 2015 +0200 +++ b/Resources/CMake/DcmtkConfiguration.cmake Wed Jun 03 21:14:05 2015 +0200 @@ -21,7 +21,7 @@ "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/dcmtk-3.6.0.zip" "${DCMTK_SOURCES_DIR}") - IF(CMAKE_CROSSCOMPILING) + IF (CMAKE_CROSSCOMPILING) SET(C_CHAR_UNSIGNED 1 CACHE INTERNAL "Whether char is unsigned.") ENDIF() SET(DCMTK_SOURCE_DIR ${CMAKE_BINARY_DIR}/dcmtk-3.6.0)
--- a/Resources/CMake/JsonCppConfiguration.cmake Wed Jun 03 17:38:39 2015 +0200 +++ b/Resources/CMake/JsonCppConfiguration.cmake Wed Jun 03 21:14:05 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/Resources/CMake/LibPngConfiguration.cmake Wed Jun 03 17:38:39 2015 +0200 +++ b/Resources/CMake/LibPngConfiguration.cmake Wed Jun 03 21:14:05 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/Resources/CMake/MongooseConfiguration.cmake Wed Jun 03 17:38:39 2015 +0200 +++ b/Resources/CMake/MongooseConfiguration.cmake Wed Jun 03 21:14:05 2015 +0200 @@ -32,7 +32,7 @@ ${MONGOOSE_SOURCES_DIR} ) - list(APPEND THIRD_PARTY_SOURCES + set(MONGOOSE_SOURCES ${MONGOOSE_SOURCES_DIR}/mongoose.c )
--- a/Resources/CMake/PugixmlConfiguration.cmake Wed Jun 03 17:38:39 2015 +0200 +++ b/Resources/CMake/PugixmlConfiguration.cmake Wed Jun 03 21:14:05 2015 +0200 @@ -14,10 +14,7 @@ ) set(PUGIXML_SOURCES - ${PUGIXML_SOURCES_DIR}/src/vlog_is_on.cc - ) - - list(APPEND THIRD_PARTY_SOURCES + #${PUGIXML_SOURCES_DIR}/src/vlog_is_on.cc ${PUGIXML_SOURCES_DIR}/src/pugixml.cpp )
--- a/Resources/CMake/SQLiteConfiguration.cmake Wed Jun 03 17:38:39 2015 +0200 +++ b/Resources/CMake/SQLiteConfiguration.cmake Wed Jun 03 21:14:05 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/Resources/CMake/ZlibConfiguration.cmake Wed Jun 03 17:38:39 2015 +0200 +++ b/Resources/CMake/ZlibConfiguration.cmake Wed Jun 03 21:14:05 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