changeset 73:da73be4b361b

no more need of "-DORTHANC_FRAMEWORK_ADDITIONAL_LIBRARIES" to link against system-wide orthanc framework
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 12 Jun 2021 08:00:57 +0200
parents 38b0a6a1ca56
children 5217f6f8a8cf cbfc72a53970
files CMakeLists.txt
diffstat 1 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/CMakeLists.txt	Fri Jun 11 17:11:34 2021 +0200
+++ b/CMakeLists.txt	Sat Jun 12 08:00:57 2021 +0200
@@ -46,12 +46,15 @@
 include_directories(${ORTHANC_FRAMEWORK_ROOT})
 
 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "system")
-  if (NOT ORTHANC_FRAMEWORK_ADDITIONAL_LIBRARIES STREQUAL "")
-    # https://stackoverflow.com/a/5272993/881731
-    string(REPLACE " " ";" tmp ${ORTHANC_FRAMEWORK_ADDITIONAL_LIBRARIES})
-    link_libraries(${tmp})
+  include(FindBoost)
+  find_package(Boost COMPONENTS filesystem regex thread)
+
+  if (NOT Boost_FOUND)
+    message(FATAL_ERROR "Unable to locate Boost on this system")
   endif()
-  
+
+  link_libraries(${Boost_LIBRARIES} jsoncpp)
+
 else()
   include(${ORTHANC_FRAMEWORK_ROOT}/../Resources/CMake/OrthancFrameworkParameters.cmake)