]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: do not use CMP0074 unless it is supported
authorKefu Chai <kchai@redhat.com>
Tue, 3 Dec 2019 01:50:10 +0000 (09:50 +0800)
committerKefu Chai <kchai@redhat.com>
Sat, 28 Dec 2019 04:33:51 +0000 (12:33 +0800)
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>
(cherry picked from commit dd0cdb3eb6cffc8cc0bb5d4ba0a54fd67c5bfd3a)

cmake/modules/FindBoost.cmake

index 0e0c2d14fff76de34dd08f0f4ab5d782458a6436..001d7cfa48e8b63684dde560d65d7fb085723773 100644 (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)