hc
2024-08-13 72be3801e63d82671c9d90577a9efb3126a6aa37
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From 881705ec581ab7cd61c8e4fe134db8854a83ec4e Mon Sep 17 00:00:00 2001
From: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
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 <gwenhael.goavec-merou@trabucayre.com>
---
 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