Merge pull request #31958 from tchaikov/wip-cmake-new-policy

cmake: do not use CMP0074 unless it is supported

Reviewed-by: Samuel Just <sjust@redhat.com>
This commit is contained in:
Kefu Chai 2019-12-03 10:48:39 +08:00 committed by GitHub
commit aa9e60037c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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)