cmake: do not use CMP0074 unless it is supported

CMake CMP0074 was introduced by CMake 3.12, but we only require CMake
v3.10.2. so default to check `Boost_ROOT` unless specified otherwise.

Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2019-12-03 09:50:10 +08:00
parent c794ebb26e
commit dd0cdb3eb6

View File

@ -1492,11 +1492,15 @@ if(WIN32)
INTERFACE_COMPILE_DEFINITIONS "BOOST_ALL_NO_LIB")
endif()
cmake_policy(GET CMP0074 _Boost_CMP0074)
if(NOT "x${_Boost_CMP0074}x" STREQUAL "xNEWx")
if(POLICY CMP0074)
cmake_policy(GET CMP0074 _Boost_CMP0074)
if(NOT "x${_Boost_CMP0074}x" STREQUAL "xNEWx")
_Boost_CHECK_SPELLING(Boost_ROOT)
endif()
unset(_Boost_CMP0074)
else()
_Boost_CHECK_SPELLING(Boost_ROOT)
endif()
unset(_Boost_CMP0074)
_Boost_CHECK_SPELLING(Boost_LIBRARYDIR)
_Boost_CHECK_SPELLING(Boost_INCLUDEDIR)