From: Kefu Chai Date: Sat, 27 Aug 2022 01:47:44 +0000 (+0800) Subject: cmake: use a loop for setting new policies X-Git-Tag: v18.0.0~144^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=591e0c6195ab769e5fc96075ce48cb7c2a26407a;p=ceph.git cmake: use a loop for setting new policies we were using a for loop for this purpose, but the for loop was unrolled when we bumped up the required cmake version. this change paves the road to setting "CMP0135" to "NEW". this policy is a new one introduced by CMake v3.24. Signed-off-by: Kefu Chai --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 40c8b6342581..df17fed6b152 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,8 +14,10 @@ cmake_policy(SET CMP0065 NEW) cmake_policy(SET CMP0074 NEW) cmake_policy(SET CMP0075 NEW) cmake_policy(SET CMP0093 NEW) -if(POLICY CMP0127) - cmake_policy(SET CMP0127 NEW) +foreach(policy CMP0127) + if(POLICY ${policy}) + cmake_policy(SET ${policy} NEW) + endif() endif() list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules/")