diff OrthancServer/CMakeLists.txt @ 4761:31e12d2ce275

Linux Standard Base (LSB) builds of Orthanc can load non-LSB builds of plugins
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 02 Aug 2021 13:00:37 +0200
parents cc64385593ef
children 61da49321754 7053502fbf97
line wrap: on
line diff
--- a/OrthancServer/CMakeLists.txt	Wed Jul 21 10:46:46 2021 +0200
+++ b/OrthancServer/CMakeLists.txt	Mon Aug 02 13:00:37 2021 +0200
@@ -397,6 +397,16 @@
 
 target_link_libraries(Orthanc ServerLibrary CoreLibrary ${DCMTK_LIBRARIES})
 
+if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase")
+  # The link flag below hides all the global functions so that a Linux
+  # Standard Base (LSB) build of Orthanc can load plugins that are not
+  # built using LSB (new in Orthanc 1.9.7)
+  set_property(
+    TARGET Orthanc
+    PROPERTY LINK_FLAGS "-Wl,--version-script=${CMAKE_SOURCE_DIR}/Resources/VersionScriptOrthanc.map"
+    )
+endif()
+
 install(
   TARGETS Orthanc
   RUNTIME DESTINATION sbin