changeset 277:58f969933720

merge with Orthanc-0.3.1
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sun, 09 Dec 2012 15:03:17 +0100
parents 8af8754a7a8e (current diff) 3b3525dee661 (diff)
children 771f12042be9
files CMakeLists.txt
diffstat 3 files changed, 70 insertions(+), 55 deletions(-) [+]
line wrap: on
line diff
--- a/CMakeLists.txt	Sun Dec 09 14:45:10 2012 +0100
+++ b/CMakeLists.txt	Sun Dec 09 15:03:17 2012 +0100
@@ -20,6 +20,7 @@
 SET(USE_DYNAMIC_SQLITE ON CACHE BOOL "Use the dynamic version of SQLite")
 SET(DEBIAN_FORCE_HARDENING OFF CACHE BOOL "Force the injection of Debian hardening flags (unrecommended)")
 SET(DEBIAN_USE_GTEST_SOURCE_PACKAGE OFF CACHE BOOL "Use the sources of Google Test shipped with libgtest-dev (only for Debian sid)")
+SET(ONLY_CORE_LIBRARY OFF CACHE BOOL "Only build the core library")
 
 mark_as_advanced(USE_DYNAMIC_JSONCPP)
 mark_as_advanced(USE_DYNAMIC_GOOGLE_LOG)
@@ -27,6 +28,7 @@
 mark_as_advanced(USE_DYNAMIC_SQLITE)
 mark_as_advanced(DEBIAN_FORCE_HARDENING)
 mark_as_advanced(DEBIAN_USE_STATIC_GOOGLE_TEST)
+mark_as_advanced(ONLY_CORE_LIBRARY)
 
 # Some basic inclusions
 include(CheckIncludeFiles)
@@ -78,7 +80,11 @@
 endif()
 
 include(${CMAKE_SOURCE_DIR}/Resources/CMake/BoostConfiguration.cmake)
-include(${CMAKE_SOURCE_DIR}/Resources/CMake/DcmtkConfiguration.cmake)
+
+if(NOT ONLY_CORE_LIBRARY)
+  include(${CMAKE_SOURCE_DIR}/Resources/CMake/DcmtkConfiguration.cmake)
+endif()
+
 include(${CMAKE_SOURCE_DIR}/Resources/CMake/MongooseConfiguration.cmake)
 include(${CMAKE_SOURCE_DIR}/Resources/CMake/ZlibConfiguration.cmake)
 include(${CMAKE_SOURCE_DIR}/Resources/CMake/SQLiteConfiguration.cmake)
@@ -133,56 +139,60 @@
   OrthancCppClient/HttpException.cpp
   )  
 
-add_library(ServerLibrary
-  OrthancServer/DicomProtocol/DicomFindAnswers.cpp
-  OrthancServer/DicomProtocol/DicomServer.cpp
-  OrthancServer/DicomProtocol/DicomUserConnection.cpp
-  OrthancServer/FromDcmtkBridge.cpp
-  OrthancServer/Internals/CommandDispatcher.cpp
-  OrthancServer/Internals/FindScp.cpp
-  OrthancServer/Internals/MoveScp.cpp
-  OrthancServer/Internals/StoreScp.cpp
-  OrthancServer/OrthancInitialization.cpp
-  OrthancServer/OrthancRestApi.cpp
-  OrthancServer/ServerIndex.cpp
-  OrthancServer/ToDcmtkBridge.cpp
-  OrthancServer/DatabaseWrapper.cpp
-  OrthancServer/ServerContext.cpp
-  OrthancServer/ServerEnumerations.cpp
-  OrthancServer/ServerToolbox.cpp
-  )
-
-# Ensure autogenerated code is built before building ServerLibrary
-add_dependencies(ServerLibrary CoreLibrary)
-
-add_executable(Orthanc
-  OrthancServer/main.cpp
-  )
-
-target_link_libraries(Orthanc ServerLibrary CoreLibrary)
-
-install(
-  TARGETS Orthanc
-  RUNTIME DESTINATION bin
-  )
 
 
-# Build the unit tests if required
-if (BUILD_UNIT_TESTS)
-  include(${CMAKE_SOURCE_DIR}/Resources/CMake/GoogleTestConfiguration.cmake)
-  add_executable(UnitTests
-    ${GTEST_SOURCES}
-    UnitTests/MessageWithDestination.cpp
-    UnitTests/RestApi.cpp
-    UnitTests/SQLite.cpp
-    UnitTests/SQLiteChromium.cpp
-    UnitTests/ServerIndex.cpp
-    UnitTests/Versions.cpp
-    UnitTests/Zip.cpp
-    UnitTests/FileStorage.cpp
-    UnitTests/main.cpp
+if(NOT ONLY_CORE_LIBRARY)
+  add_library(ServerLibrary
+    ${DCMTK_SOURCES}
+    OrthancServer/DicomProtocol/DicomFindAnswers.cpp
+    OrthancServer/DicomProtocol/DicomServer.cpp
+    OrthancServer/DicomProtocol/DicomUserConnection.cpp
+    OrthancServer/FromDcmtkBridge.cpp
+    OrthancServer/Internals/CommandDispatcher.cpp
+    OrthancServer/Internals/FindScp.cpp
+    OrthancServer/Internals/MoveScp.cpp
+    OrthancServer/Internals/StoreScp.cpp
+    OrthancServer/OrthancInitialization.cpp
+    OrthancServer/OrthancRestApi.cpp
+    OrthancServer/ServerIndex.cpp
+    OrthancServer/ToDcmtkBridge.cpp
+    OrthancServer/DatabaseWrapper.cpp
+    OrthancServer/ServerContext.cpp
+    OrthancServer/ServerEnumerations.cpp
+    OrthancServer/ServerToolbox.cpp
     )
-  target_link_libraries(UnitTests ServerLibrary CoreLibrary)
+
+  # Ensure autogenerated code is built before building ServerLibrary
+  add_dependencies(ServerLibrary CoreLibrary)
+
+  add_executable(Orthanc
+    OrthancServer/main.cpp
+    )
+
+  target_link_libraries(Orthanc ServerLibrary CoreLibrary)
+
+  install(
+    TARGETS Orthanc
+    RUNTIME DESTINATION bin
+    )
+
+  # Build the unit tests if required
+  if (BUILD_UNIT_TESTS)
+    include(${CMAKE_SOURCE_DIR}/Resources/CMake/GoogleTestConfiguration.cmake)
+    add_executable(UnitTests
+      ${GTEST_SOURCES}
+      UnitTests/MessageWithDestination.cpp
+      UnitTests/RestApi.cpp
+      UnitTests/SQLite.cpp
+      UnitTests/SQLiteChromium.cpp
+      UnitTests/ServerIndex.cpp
+      UnitTests/Versions.cpp
+      UnitTests/Zip.cpp
+      UnitTests/FileStorage.cpp
+      UnitTests/main.cpp
+      )
+    target_link_libraries(UnitTests ServerLibrary CoreLibrary)
+  endif()
 endif()
 
 
--- a/Core/HttpServer/FilesystemHttpSender.cpp	Sun Dec 09 14:45:10 2012 +0100
+++ b/Core/HttpServer/FilesystemHttpSender.cpp	Sun Dec 09 15:03:17 2012 +0100
@@ -40,7 +40,12 @@
   void FilesystemHttpSender::Setup()
   {
     //SetDownloadFilename(path_.filename().string());
+
+#if BOOST_HAS_FILESYSTEM_V3 == 1
     SetContentType(Toolbox::AutodetectMimeType(path_.filename().string()));
+#else
+    SetContentType(Toolbox::AutodetectMimeType(path_.filename()));
+#endif
   }
 
   uint64_t FilesystemHttpSender::GetFileSize()
--- a/Resources/CMake/DcmtkConfiguration.cmake	Sun Dec 09 14:45:10 2012 +0100
+++ b/Resources/CMake/DcmtkConfiguration.cmake	Sun Dec 09 15:03:17 2012 +0100
@@ -27,24 +27,24 @@
     ${DCMTK_SOURCES_DIR}/CMake/osconfig.h.in
     ${DCMTK_SOURCES_DIR}/config/include/dcmtk/config/osconfig.h)
 
-  AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmnet/libsrc THIRD_PARTY_SOURCES)
-  AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmdata/libsrc THIRD_PARTY_SOURCES)
-  AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/ofstd/libsrc THIRD_PARTY_SOURCES)
+  AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmnet/libsrc DCMTK_SOURCES)
+  AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmdata/libsrc DCMTK_SOURCES)
+  AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/ofstd/libsrc DCMTK_SOURCES)
 
   # Source for the logging facility of DCMTK
-  AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/oflog/libsrc THIRD_PARTY_SOURCES)
+  AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/oflog/libsrc DCMTK_SOURCES)
   if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
-    list(REMOVE_ITEM THIRD_PARTY_SOURCES 
+    list(REMOVE_ITEM DCMTK_SOURCES 
       ${DCMTK_SOURCES_DIR}/oflog/libsrc/windebap.cc
       ${DCMTK_SOURCES_DIR}/oflog/libsrc/winsock.cc
       )
   elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
-    list(REMOVE_ITEM THIRD_PARTY_SOURCES 
+    list(REMOVE_ITEM DCMTK_SOURCES 
       ${DCMTK_SOURCES_DIR}/oflog/libsrc/unixsock.cc
       )
   endif()
 
-  list(REMOVE_ITEM THIRD_PARTY_SOURCES 
+  list(REMOVE_ITEM DCMTK_SOURCES 
     ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/mkdictbi.cc
     ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/mkdeftag.cc
     ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/dcdictbi.cc