changeset 390:7c787ee1f3ae

compatibility with cmake 4.0
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 08 Apr 2025 14:59:36 +0200 (6 weeks ago)
parents 7954645ed874
children 6d9987f30612 e6bd4fa3c71e
files Applications/CMakeLists.txt ViewerPlugin/CMakeLists.txt
diffstat 2 files changed, 14 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Applications/CMakeLists.txt	Tue Apr 08 14:47:47 2025 +0200
+++ b/Applications/CMakeLists.txt	Tue Apr 08 14:59:36 2025 +0200
@@ -51,7 +51,13 @@
 
 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "system")
   if (ORTHANC_FRAMEWORK_USE_SHARED)    
-    include(FindBoost)
+    # https://cmake.org/cmake/help/latest/policy/CMP0167.html
+    if (CMAKE_VERSION VERSION_GREATER "3.30")
+      find_package(Boost CONFIG)
+    else()
+      include(FindBoost)
+    endif()
+
     find_package(Boost COMPONENTS filesystem program_options regex system thread date_time)
     
     if (NOT Boost_FOUND)
--- a/ViewerPlugin/CMakeLists.txt	Tue Apr 08 14:47:47 2025 +0200
+++ b/ViewerPlugin/CMakeLists.txt	Tue Apr 08 14:59:36 2025 +0200
@@ -54,7 +54,13 @@
 
 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "system")
   if (ORTHANC_FRAMEWORK_USE_SHARED)
-    include(FindBoost)
+    # https://cmake.org/cmake/help/latest/policy/CMP0167.html
+    if (CMAKE_VERSION VERSION_GREATER "3.30")
+      find_package(Boost CONFIG)
+    else()
+      include(FindBoost)
+    endif()
+
     find_package(Boost COMPONENTS system thread)
     
     if (NOT Boost_FOUND)