From 881705ec581ab7cd61c8e4fe134db8854a83ec4e Mon Sep 17 00:00:00 2001 From: Gwenhael Goavec-Merou Date: Tue, 28 Apr 2020 16:56:29 +0200 Subject: [PATCH] host: CMakeLists: add boost unit_test_framework required only when ENABLE_TESTS=ON By default, boost unit_test_framework is always required, but only use when ENABLE_TESTS=ON. This PR suppress unit_test_framework to the default list and append UHD_BOOST_REQUIRED_COMPONENTS when this library is needed [backported from https://github.com/EttusResearch/uhd/pull/341] Signed-off-by: Gwenhael Goavec-Merou --- host/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt index 8f72ece76..a7731ffbd 100644 --- a/host/CMakeLists.txt +++ b/host/CMakeLists.txt @@ -291,10 +291,14 @@ set(UHD_BOOST_REQUIRED_COMPONENTS filesystem program_options system - unit_test_framework serialization thread ) + +if(ENABLE_TESTS) + list(APPEND UHD_BOOST_REQUIRED_COMPONENTS unit_test_framework) +endif(ENABLE_TESTS) + include(UHDBoost) include_directories(${Boost_INCLUDE_DIRS}) -- 2.26.2