[CMake] enable CMP0144 policy if available (#96589)

- Enable CMP0144 policy if available, this will make the find_package()
more robust.

Signed-off-by: Jerry Zhang Jian <jerry.zhangjian@sifive.com>
This commit is contained in:
Jerry Zhang Jian 2024-07-02 01:37:11 +08:00 committed by GitHub
parent 1b704e889f
commit 9f3bfbb680
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -23,3 +23,9 @@ endif()
if(POLICY CMP0141)
cmake_policy(SET CMP0141 NEW)
endif()
# CMP0144: find_package() uses uppercase <PackageName>_ROOT variables.
# New in CMake 3.27: https://cmake.org/cmake/help/latest/policy/CMP0144.html
if(POLICY CMP0144)
cmake_policy(SET CMP0144 NEW)
endif()