From a3061b8fe69fb8407d52d7f43cae57796015d185 Mon Sep 17 00:00:00 2001
From: Volker Schroer <3470424+dl1ksv@users.noreply.github.com>
Date: Tue, 24 Nov 2020 12:37:05 +0100
Subject: Do not disable boost, if only the unit_test_framework is missing

---
 cmake/Modules/GrBoost.cmake | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

(limited to 'cmake/Modules')

diff --git a/cmake/Modules/GrBoost.cmake b/cmake/Modules/GrBoost.cmake
index 92de7d538b..f73dd856ad 100644
--- a/cmake/Modules/GrBoost.cmake
+++ b/cmake/Modules/GrBoost.cmake
@@ -23,10 +23,6 @@ set(BOOST_REQUIRED_COMPONENTS
     thread
 )
 
-if(ENABLE_TESTING)
-    list(APPEND BOOST_REQUIRED_COMPONENTS unit_test_framework)
-endif(ENABLE_TESTING)
-
 if(UNIX AND NOT BOOST_ROOT AND EXISTS "/usr/lib64")
     list(APPEND BOOST_LIBRARYDIR "/usr/lib64") #fedora 64-bit fix
 endif(UNIX AND NOT BOOST_ROOT AND EXISTS "/usr/lib64")
@@ -73,7 +69,8 @@ set(Boost_ADDITIONAL_VERSIONS
     "1.71.0" "1.71"
 )
 
-find_package(Boost ${GR_BOOST_MIN_VERSION} COMPONENTS ${BOOST_REQUIRED_COMPONENTS})
+find_package(Boost ${GR_BOOST_MIN_VERSION} REQUIRED ${BOOST_REQUIRED_COMPONENTS}
+                                           OPTIONAL_COMPONENTS unit_test_framework)
 
 # Boost 1.52 disabled, see https://svn.boost.org/trac/boost/ticket/7669
 # Similar problems with Boost 1.46 and 1.47.
-- 
cgit v1.2.3