From c63b36e6b28e5dcae43faa37a88dbd2113080eea Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 6 Mar 2024 16:51:06 +0100 Subject: [PATCH] Fix upper-case package root CMake warning CMake 3.27 introduced the new policy CMP0144 which makes it so the find_Package() functions use the upper-case _ROOT variable when set. It is off by default, but it does check for the possible interference and warns about it. The warning happens when the upper case package root variable is set, and a find_package() is called with a lower case package name. In practice this leads to issue with CMake on macOS where the TIFF_ROOT is set to an expected variable, and find_package is used to find TIFF. THe CMake's FindTIFF.cmake attempts to find CMake configuration of the tiff library using find_package(tiff CONFIG) which triggers the policy warning. This change makes it so the policy is set to NEW, silencing the warning and bringing us to a more desired/expected behavior. Pull Request: https://projects.blender.org/blender/blender/pulls/119120 --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 18381a94413..0fabdf8363f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -84,6 +84,11 @@ if(POLICY CMP0074) cmake_policy(SET CMP0074 NEW) endif() +# find_package() uses uppercase _ROOT variables. +if(POLICY CMP0144) + cmake_policy(SET CMP0144 NEW) +endif() + # Install CODE|SCRIPT allow the use of generator expressions. if(POLICY CMP0087) cmake_policy(SET CMP0087 NEW)