File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -31,14 +31,27 @@ endif()
31
31
32
32
set (BOOST_COMPONENTS "filesystem;unit_test_framework;program_options;system" )
33
33
34
+ # CMake >= 3.30 should not use the vendored boost
35
+ if (POLICY CMP0167 )
36
+ cmake_policy (SET CMP0167 NEW )
37
+ endif ()
34
38
if (WIN32 )
35
39
# Boost 1.77 fixes a bug that causes crashes on Windows for some relative paths in --allow-paths.
36
40
# See https://github.com/boostorg/filesystem/issues/201
37
41
find_package (Boost 1.77.0 QUIET REQUIRED COMPONENTS ${BOOST_COMPONENTS} )
38
42
else ()
39
43
# Boost 1.65 is the first to also provide boost::get for rvalue-references (#5787).
40
44
# Boost 1.67 moved container_hash into is own module.
41
- find_package (Boost 1.67.0 QUIET REQUIRED COMPONENTS ${BOOST_COMPONENTS} )
45
+ # Boost 1.70 comes with its own BoostConfig.cmake and is the new (non-deprecated) behavior
46
+ find_package (Boost 1.70.0 QUIET COMPONENTS ${BOOST_COMPONENTS} )
47
+ if (NOT ${Boost_FOUND} )
48
+ # If the boost version is < 1.70.0, there is no boost config delivered with it, revert to old behavior
49
+ # todo drop this once cmake minimum version >= 3.30 is reached
50
+ if (POLICY CMP0167 )
51
+ cmake_policy (SET CMP0167 OLD )
52
+ endif ()
53
+ find_package (Boost 1.67.0 QUIET REQUIRED COMPONENTS ${BOOST_COMPONENTS} )
54
+ endif ()
42
55
endif ()
43
56
44
57
# If cmake is older than boost and boost is older than 1.70,
You can’t perform that action at this time.
0 commit comments