Mercurial > hg > orthanc
diff OrthancServer/CMakeLists.txt @ 5263:ae3f29be5ca5
fix compatibility with visual studio precompiled headers
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 12 Apr 2023 17:38:44 +0200 |
parents | bf304ee8dd80 |
children | 0e8dfba67ac9 |
line wrap: on
line diff
--- a/OrthancServer/CMakeLists.txt Wed Apr 12 15:53:32 2023 +0200 +++ b/OrthancServer/CMakeLists.txt Wed Apr 12 17:38:44 2023 +0200 @@ -492,65 +492,35 @@ if (ENABLE_PLUGINS AND (BUILD_SERVE_FOLDERS OR BUILD_MODALITY_WORKLISTS OR BUILD_HOUSEKEEPER OR BUILD_DELAYED_DELETION)) - set(PLUGINS_FRAMEWORK_SOURCES + set(PLUGINS_DEPENDENCIES_SOURCES ${BOOST_SOURCES} ${JSONCPP_SOURCES} ${LIBICONV_SOURCES} ${LIBICU_SOURCES} + ${PUGIXML_SOURCES} + ${UUID_SOURCES} + ${ZLIB_SOURCES} + + ${CMAKE_SOURCE_DIR}/../OrthancFramework/Resources/ThirdParty/base64/base64.cpp + ${CMAKE_SOURCE_DIR}/../OrthancFramework/Resources/ThirdParty/md5/md5.c Plugins/Samples/Common/OrthancPluginCppWrapper.cpp ) if (BUILD_DELAYED_DELETION) - list(APPEND PLUGINS_FRAMEWORK_SOURCES - ${CMAKE_SOURCE_DIR}/../OrthancFramework/Resources/ThirdParty/base64/base64.cpp - ${CMAKE_SOURCE_DIR}/../OrthancFramework/Resources/ThirdParty/md5/md5.c - ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/ChunkedBuffer.cpp - ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/Compression/DeflateBaseCompressor.cpp - ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/Compression/GzipCompressor.cpp - ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/Compression/HierarchicalZipWriter.cpp - ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/Compression/IBufferCompressor.cpp - ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/Compression/ZipReader.cpp - ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/Compression/ZipWriter.cpp - ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/Compression/ZlibCompressor.cpp - ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/DicomFormat/DicomTag.cpp - ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/Enumerations.cpp - ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/FileStorage/FilesystemStorage.cpp - ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/Logging.cpp - ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/MultiThreading/SharedMessageQueue.cpp - ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/OrthancException.cpp - ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/SQLite/Connection.cpp - ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/SQLite/FunctionContext.cpp - ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/SQLite/Statement.cpp - ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/SQLite/StatementId.cpp - ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/SQLite/StatementReference.cpp - ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/SQLite/Transaction.cpp - ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/StringMemoryBuffer.cpp - ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/SystemToolbox.cpp - ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/Toolbox.cpp + list(APPEND PLUGINS_DEPENDENCIES_SOURCES ${DCMTK_SOURCES} - ${PUGIXML_SOURCES} - ${UUID_SOURCES} - ${ZLIB_SOURCES} ${SQLITE_SOURCES} ) endif() - add_library(PluginsFramework STATIC - ${PLUGINS_FRAMEWORK_SOURCES} - ) - - # Remove the dependency upon ICU in plugins, as this greatly - # increase the size of the resulting binaries, since they must - # embed the ICU dictionary. - set_target_properties( - PluginsFramework - PROPERTIES COMPILE_DEFINITIONS "ORTHANC_ENABLE_ICU=0" + add_library(PluginsDependencies STATIC + ${PLUGINS_DEPENDENCIES_SOURCES} ) # Add the "-fPIC" option as this static library must be embedded # inside shared libraries (important on UNIX) set_target_properties( - PluginsFramework + PluginsDependencies PROPERTIES POSITION_INDEPENDENT_CODE ON ) endif() @@ -587,7 +557,7 @@ ${SERVE_FOLDERS_RESOURCES} ) - target_link_libraries(ServeFolders PluginsFramework) + target_link_libraries(ServeFolders PluginsDependencies) set_target_properties( ServeFolders PROPERTIES @@ -635,7 +605,7 @@ ${MODALITY_WORKLISTS_RESOURCES} ) - target_link_libraries(ModalityWorklists PluginsFramework) + target_link_libraries(ModalityWorklists PluginsDependencies) set_target_properties( ModalityWorklists PROPERTIES @@ -687,13 +657,16 @@ PROPERTIES COMPILE_DEFINITIONS "ORTHANC_PLUGIN_NAME=\"connectivity-checks\";ORTHANC_PLUGIN_VERSION=\"${ORTHANC_VERSION}\"" ) + # The "OrthancFrameworkDependencies.cpp" file is used to bypass the + # precompiled headers if compiling with Visual Studio add_library(ConnectivityChecks SHARED ${AUTOGENERATED_DIR}/ConnectivityChecksResources.cpp ${CMAKE_SOURCE_DIR}/Plugins/Samples/ConnectivityChecks/Plugin.cpp + ${CMAKE_SOURCE_DIR}/Plugins/Samples/ConnectivityChecks/OrthancFrameworkDependencies.cpp ${CONNECTIVITY_CHECKS_RESOURCES} ) - target_link_libraries(ConnectivityChecks PluginsFramework) + target_link_libraries(ConnectivityChecks PluginsDependencies) set_target_properties( ConnectivityChecks PROPERTIES @@ -734,15 +707,18 @@ ${CMAKE_SOURCE_DIR}/Plugins/Samples/DelayedDeletion/Plugin.cpp PROPERTIES COMPILE_DEFINITIONS "ORTHANC_PLUGIN_NAME=\"delayed-deletion\";ORTHANC_PLUGIN_VERSION=\"${ORTHANC_VERSION}\"" ) - + + # The "OrthancFrameworkDependencies.cpp" file is used to bypass the + # precompiled headers if compiling with Visual Studio add_library(DelayedDeletion SHARED ${CMAKE_SOURCE_DIR}/Plugins/Engine/PluginsEnumerations.cpp ${CMAKE_SOURCE_DIR}/Plugins/Samples/DelayedDeletion/PendingDeletionsDatabase.cpp ${CMAKE_SOURCE_DIR}/Plugins/Samples/DelayedDeletion/Plugin.cpp + ${CMAKE_SOURCE_DIR}/Plugins/Samples/DelayedDeletion/OrthancFrameworkDependencies.cpp ${DELAYED_DELETION_RESOURCES} ) - target_link_libraries(DelayedDeletion PluginsFramework ${DCMTK_LIBRARIES}) + target_link_libraries(DelayedDeletion PluginsDependencies ${DCMTK_LIBRARIES}) set_target_properties( DelayedDeletion PROPERTIES @@ -789,9 +765,7 @@ ${HOUSEKEEPER_RESOURCES} ) - target_link_libraries(Housekeeper - PluginsFramework - ) + target_link_libraries(Housekeeper PluginsDependencies) set_target_properties( Housekeeper PROPERTIES