From 0d46a7239634f592a0281fad816420cfe7a21bd2 Mon Sep 17 00:00:00 2001 From: Chris Hennes Date: Wed, 19 Feb 2025 19:17:56 -0600 Subject: [PATCH] CMake: Add policy 0177 to normalize install paths Also sort policies by number. --- CMakeLists.txt | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ed3af58e9..abced4aca7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,26 @@ # As of February 2025 we require CMake 3.22.0 cmake_minimum_required(VERSION 3.22.0 FATAL_ERROR) + +# As of cMake 3.27, find_package() will look for both case-sensitive and all-uppercase versions +# of the package. This seems to affect FLANN as included by Pixi +if(POLICY CMP0144) + cmake_policy(SET CMP0144 NEW) +endif() + +# FindPythonInterp and FindPythonLibs modules are deprecated, but are still in use by +# all versions of Shiboken2. This policy must be kept at OLD until Shiboken2 is no longer +# supported +if(POLICY CMP0148) + cmake_policy(SET CMP0148 OLD) +endif() + +# The exec_program command was deprecated in cMake 3.0, and policy CMP0153 was added in cMake +# 3.28 to control whether this gives a warning (the OLD behavior) or a fatal error (NEW) +if(POLICY CMP0153) + cmake_policy(SET CMP0153 NEW) +endif() + # Suppress 'FindBoost module is removed' warning. Will use BoostConfig.cmake instead if(POLICY CMP0167) cmake_policy(SET CMP0167 NEW) @@ -11,24 +31,11 @@ if(POLICY CMP0175) cmake_policy(SET CMP0175 NEW) endif() -# FindPythonInterp and FindPythonLibs modules are deprecated, but are still in use by -# all versions of Shiboken2. This policy must be kept at OLD until Shiboken2 is no longer -# supported -if(POLICY CMP0148) - cmake_policy(SET CMP0148 OLD) +# Added in cMake 3.31, enforce normalization of all DESTINATION paths given to install() +if(POLICY CMP0177) + cmake_policy(SET CMP0177 NEW) endif() -# As of cMake 3.27, find_package() will look for both case-sensitive and all-uppercase versions -# of the package. This seems to affect FLANN as included by Pixi -if(POLICY CMP0144) - cmake_policy(SET CMP0144 NEW) -endif() - -# The exec_program command was deprecated in cMake 3.0, and policy CMP0153 was added in cMake -# 3.28 to control whether this gives a warning (the OLD behavior) or a fatal error (NEW) -if(POLICY CMP0153) - cmake_policy(SET CMP0153 NEW) -endif() option(FREECAD_USE_CCACHE "Auto detect and use ccache during compilation" ON)