1From 881705ec581ab7cd61c8e4fe134db8854a83ec4e Mon Sep 17 00:00:00 2001
2From: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
3Date: Tue, 28 Apr 2020 16:56:29 +0200
4Subject: [PATCH] host: CMakeLists: add boost unit_test_framework required only
5 when ENABLE_TESTS=ON
6
7By default, boost unit_test_framework is always required, but only use
8when ENABLE_TESTS=ON.
9This PR suppress unit_test_framework to the default list and append
10UHD_BOOST_REQUIRED_COMPONENTS when this library is needed
11
12[backported from https://github.com/EttusResearch/uhd/pull/341]
13Signed-off-by: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
14---
15 host/CMakeLists.txt | 6 +++++-
16 1 file changed, 5 insertions(+), 1 deletion(-)
17
18diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt
19index 8f72ece76..a7731ffbd 100644
20--- a/host/CMakeLists.txt
21+++ b/host/CMakeLists.txt
22@@ -291,10 +291,14 @@ set(UHD_BOOST_REQUIRED_COMPONENTS
23     filesystem
24     program_options
25     system
26-    unit_test_framework
27     serialization
28     thread
29 )
30+
31+if(ENABLE_TESTS)
32+    list(APPEND UHD_BOOST_REQUIRED_COMPONENTS unit_test_framework)
33+endif(ENABLE_TESTS)
34+
35 include(UHDBoost)
36
37 include_directories(${Boost_INCLUDE_DIRS})
38--
392.26.2
40
41