File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -28,5 +28,28 @@ function(add_boost_if_needed)
28
28
add_library (Boost::headers ALIAS Boost::boost )
29
29
endif ()
30
30
31
+ if (BUILD_TESTS )
32
+ include (CheckCXXSourceCompiles )
33
+ set (CMAKE_REQUIRED_INCLUDES ${Boost_INCLUDE_DIR} )
34
+ check_cxx_source_compiles ("
35
+ #define BOOST_TEST_MAIN
36
+ #include <boost/test/included/unit_test.hpp>
37
+ " HAVE_BOOST_INCLUDED_UNIT_TEST_H
38
+ )
39
+ if (NOT HAVE_BOOST_INCLUDED_UNIT_TEST_H )
40
+ message (FATAL_ERROR "Building test_bitcoin executable requested but boost/test/included/unit_test.hpp header not available." )
41
+ endif ()
42
+
43
+ check_cxx_source_compiles ("
44
+ #define BOOST_TEST_MAIN
45
+ #include <boost/test/included/unit_test.hpp>
46
+ #include <boost/test/unit_test.hpp>
47
+ " HAVE_BOOST_UNIT_TEST_H
48
+ )
49
+ if (NOT HAVE_BOOST_UNIT_TEST_H )
50
+ message (FATAL_ERROR "Building test_bitcoin executable requested but boost/test/unit_test.hpp header not available." )
51
+ endif ()
52
+ endif ()
53
+
31
54
mark_as_advanced (Boost_INCLUDE_DIR )
32
55
endfunction ()
You can’t perform that action at this time.
0 commit comments