From b13fc10ac8bbd0d3aeddab3fa912b954c3b5ee19 Mon Sep 17 00:00:00 2001
From: Achim Gsell <achim.gsell@psi.ch>
Date: Fri, 9 Aug 2019 17:48:47 +0200
Subject: [PATCH] check Boost version with 'find_package()'

---
 CMakeLists.txt | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index c60179a49..8b87e86e4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -126,18 +126,12 @@ if (USE_STATIC_LIBRARIES)
 endif ()
 set (Boost_USE_MULTITHREADED OFF)
 set (Boost_USE_STATIC_RUNTIME OFF)
-find_package (Boost
+find_package (Boost 1.60.0
     REQUIRED COMPONENTS chrono filesystem iostreams regex serialization system timer)
-if (Boost_INCLUDE_DIRS)
-    if (${Boost_VERSION} VERSION_LESS 106000)
-	message (FATAL_ERROR
-	       "Found Boost library is too old; required is version 1.60.0 or newer!")
-    endif ()
-    message ("Found Boost include dir: ${Boost_INCLUDE_DIR}")
-    message ("Found Boost library dir: ${Boost_LIBRARY_DIR}")
-    message ("Found Boost libraries: ${Boost_LIBRARIES}")
-    include_directories (${Boost_INCLUDE_DIRS})
-endif ()
+message ("Found Boost include dir: ${Boost_INCLUDE_DIR}")
+message ("Found Boost library dir: ${Boost_LIBRARY_DIR}")
+message ("Found Boost libraries: ${Boost_LIBRARIES}")
+include_directories (${Boost_INCLUDE_DIRS})
 
 option (ENABLE_DKS "Enable DKS" OFF)
 if (ENABLE_DKS)
-- 
GitLab