diff Resources/CMake/BoostConfiguration.cmake @ 3653:468181e2f090

Fix issue #166 (CMake find_boost version is now broken with newer boost/cmake)
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 05 Feb 2020 15:23:22 +0100
parents 74fc2a3b43bb
children 0ba17d2bcdc9
line wrap: on
line diff
--- a/Resources/CMake/BoostConfiguration.cmake	Wed Feb 05 13:22:02 2020 +0100
+++ b/Resources/CMake/BoostConfiguration.cmake	Wed Feb 05 15:23:22 2020 +0100
@@ -30,9 +30,20 @@
     message(FATAL_ERROR "Unable to locate Boost on this system")
   endif()
 
+  
+  # Patch by xnox to fix issue #166 (CMake find_boost version is now
+  # broken with newer boost/cmake)
+  # https://bitbucket.org/sjodogne/orthanc/issues/166/
+  if (POLICY CMP0093)
+    set(BOOST144 1.44)
+  else()
+    set(BOOST144 104400)
+  endif()
+  
+  
   # Boost releases 1.44 through 1.47 supply both V2 and V3 filesystem
   # http://www.boost.org/doc/libs/1_46_1/libs/filesystem/v3/doc/index.htm
-  if (${Boost_VERSION} LESS 104400)
+  if (${Boost_VERSION} LESS ${BOOST144})
     add_definitions(
       -DBOOST_HAS_FILESYSTEM_V3=0
       )