diff CMakeLists.txt @ 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 f1fb9d1aa444 3b3525dee661
children e5402c368b21 915ed24547ea
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()