From 3cd2963b01263e32f5e33d0c7267fc96888941bf Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Thu, 14 Aug 2025 12:13:44 +0500 Subject: [PATCH] cmake - fix errors on older cmake #7023 --- cmake/CMakeLists.txt | 6 ++++-- src/ifcwrap/CMakeLists.txt | 8 ++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 6ce6cbc4a2..53b8f3e9da 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -34,10 +34,12 @@ endif() add_definitions(-D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR) -if (POLICY CMP0144) +if(POLICY CMP0144) # 3.27 cmake_policy(SET CMP0144 NEW) # find_package() uses upper-case _ROOT variables. endif() -cmake_policy(SET CMP0167 OLD) +if(POLICY CMP0167) # 3.30 + cmake_policy(SET CMP0167 OLD) +endif() if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Release") diff --git a/src/ifcwrap/CMakeLists.txt b/src/ifcwrap/CMakeLists.txt index 00e1770110..930d3b6401 100644 --- a/src/ifcwrap/CMakeLists.txt +++ b/src/ifcwrap/CMakeLists.txt @@ -17,8 +17,12 @@ # # ################################################################################ -cmake_policy(SET CMP0148 OLD) -cmake_policy(SET CMP0177 OLD) +if(POLICY CMP0148) # 3.27 + cmake_policy(SET CMP0148 OLD) +endif() +if(POLICY CMP0177) # 3.31 + cmake_policy(SET CMP0177 OLD) +endif() FIND_PACKAGE(SWIG) IF(NOT SWIG_FOUND)