changeset 1487:23083810d543

removal of unneeded static libraries
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 04 Aug 2015 10:45:58 +0200
parents f967bdf8534e
children c8763b603b0e
files CMakeLists.txt Core/FileStorage/FilesystemStorage.cpp Core/Logging.cpp Core/Logging.h Resources/CMake/GoogleLogConfiguration.cmake Resources/CMake/LuaConfiguration.cmake
diffstat 6 files changed, 19 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/CMakeLists.txt	Tue Aug 04 10:01:31 2015 +0200
+++ b/CMakeLists.txt	Tue Aug 04 10:45:58 2015 +0200
@@ -25,6 +25,7 @@
 SET(DCMTK_DICTIONARY_DIR "" CACHE PATH "Directory containing the DCMTK dictionaries \"dicom.dic\" and \"private.dic\" (only when using system version of DCMTK)") 
 SET(ALLOW_DOWNLOADS OFF CACHE BOOL "Allow CMake to download packages")
 SET(UNIT_TESTS_WITH_HTTP_CONNEXIONS ON CACHE BOOL "Allow unit tests to make HTTP requests")
+SET(ENABLE_GOOGLE_LOG ON CACHE BOOL "Enable Google Log (otherwise, an internal logger is used)")
 SET(ENABLE_JPEG ON CACHE BOOL "Enable JPEG decompression")
 SET(ENABLE_JPEG_LOSSLESS ON CACHE BOOL "Enable JPEG-LS (Lossless) decompression")
 SET(ENABLE_PLUGINS ON CACHE BOOL "Enable plugins")
@@ -234,7 +235,10 @@
 ## Inclusion of third-party dependencies
 #####################################################################
 
-include(${CMAKE_SOURCE_DIR}/Resources/CMake/GoogleLogConfiguration.cmake)
+if (ENABLE_GOOGLE_LOG)
+  include(${CMAKE_SOURCE_DIR}/Resources/CMake/GoogleLogConfiguration.cmake)
+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)
@@ -364,14 +368,16 @@
   ${ORTHANC_CORE_SOURCES}
   ${AUTOGENERATED_SOURCES}
 
+  ${BOOST_SOURCES}
   ${CURL_SOURCES}
-  ${ZLIB_SOURCES}
-  ${MONGOOSE_SOURCES}
+  ${GOOGLE_LOG_SOURCES}
   ${JSONCPP_SOURCES}
-  ${BOOST_SOURCES}
+  ${LIBPNG_SOURCES}
+  ${LUA_SOURCES}
+  ${MONGOOSE_SOURCES}
+  ${PUGIXML_SOURCES}
   ${SQLITE_SOURCES}
-  ${LIBPNG_SOURCES}
-  ${PUGIXML_SOURCES}
+  ${ZLIB_SOURCES}
 
   ${CMAKE_SOURCE_DIR}/Resources/ThirdParty/md5/md5.c
   ${CMAKE_SOURCE_DIR}/Resources/ThirdParty/base64/base64.cpp
@@ -397,7 +403,7 @@
   ${ORTHANC_RESOURCES}
   )
 
-target_link_libraries(Orthanc ServerLibrary CoreLibrary ${STATIC_LUA} ${STATIC_GOOGLE_LOG} ${DCMTK_LIBRARIES})
+target_link_libraries(Orthanc ServerLibrary CoreLibrary ${DCMTK_LIBRARIES})
 
 if (${OPENSSL_SOURCES_LENGTH} GREATER 0)
   target_link_libraries(Orthanc OpenSSL)
@@ -426,7 +432,7 @@
   ${GTEST_SOURCES}
   ${ORTHANC_UNIT_TESTS_SOURCES}
   )
-target_link_libraries(UnitTests ServerLibrary CoreLibrary ${STATIC_LUA} ${STATIC_GOOGLE_LOG} ${DCMTK_LIBRARIES})
+target_link_libraries(UnitTests ServerLibrary CoreLibrary ${DCMTK_LIBRARIES})
 
 if (${OPENSSL_SOURCES_LENGTH} GREATER 0)
   target_link_libraries(UnitTests OpenSSL)
--- a/Core/FileStorage/FilesystemStorage.cpp	Tue Aug 04 10:01:31 2015 +0200
+++ b/Core/FileStorage/FilesystemStorage.cpp	Tue Aug 04 10:45:58 2015 +0200
@@ -213,7 +213,7 @@
   void FilesystemStorage::Remove(const std::string& uuid,
                                  FileContentType /*type*/)
   {
-#if HAVE_GOOGLE_LOG == 1
+#if ORTHANC_ENABLE_GOOGLE_LOG == 1
     LOG(INFO) << "Deleting file " << uuid;
 #endif
 
--- a/Core/Logging.cpp	Tue Aug 04 10:01:31 2015 +0200
+++ b/Core/Logging.cpp	Tue Aug 04 10:45:58 2015 +0200
@@ -38,6 +38,7 @@
 {  
   namespace Logging
   {
+#if ORTHANC_ENABLE_GOOGLE_LOG == 1
     void Initialize()
     {
       // Initialize Google's logging library.
@@ -70,5 +71,6 @@
         FLAGS_v = 0;
       }
     }
+#endif
   }
 }
--- a/Core/Logging.h	Tue Aug 04 10:01:31 2015 +0200
+++ b/Core/Logging.h	Tue Aug 04 10:45:58 2015 +0200
@@ -32,7 +32,7 @@
 
 #pragma once
 
-#if HAVE_GOOGLE_LOG == 1
+#if ORTHANC_ENABLE_GOOGLE_LOG == 1
 #include <stdlib.h>  // This fixes a problem in glog for recent releases of MinGW
 #include <glog/logging.h>
 #endif
--- a/Resources/CMake/GoogleLogConfiguration.cmake	Tue Aug 04 10:01:31 2015 +0200
+++ b/Resources/CMake/GoogleLogConfiguration.cmake	Tue Aug 04 10:45:58 2015 +0200
@@ -155,9 +155,6 @@
     endif()
   endif()
 
-  add_library(GoogleLog STATIC ${GOOGLE_LOG_SOURCES})
-  set(STATIC_GOOGLE_LOG GoogleLog)
-
 else()
   CHECK_INCLUDE_FILE_CXX(glog/logging.h HAVE_GOOGLE_LOG_H)
   if (NOT HAVE_GOOGLE_LOG_H)
@@ -175,4 +172,4 @@
   add_definitions(-DHAVE_SECURE_STRING_EXTENSIONS=0)
 endif()
 
-add_definitions(-DHAVE_GOOGLE_LOG=1)
+add_definitions(-DORTHANC_ENABLE_GOOGLE_LOG=1)
--- a/Resources/CMake/LuaConfiguration.cmake	Tue Aug 04 10:01:31 2015 +0200
+++ b/Resources/CMake/LuaConfiguration.cmake	Tue Aug 04 10:45:58 2015 +0200
@@ -50,9 +50,6 @@
     ${LUA_SOURCES_DIR}/src/linit.c
     )
 
-  add_library(Lua STATIC ${LUA_SOURCES})
-  set(STATIC_LUA Lua)
-
   source_group(ThirdParty\\Lua REGULAR_EXPRESSION ${LUA_SOURCES_DIR}/.*)
 
 else()