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)
2828    add_library (Boost::headers ALIAS Boost::boost)
2929  endif ()
3030
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+ 
3154  mark_as_advanced (Boost_INCLUDE_DIR)
3255endfunction ()
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments