Skip to content

Commit

Permalink
[CMake] enable CMP0144 policy if available (#96589)
Browse files Browse the repository at this point in the history
- Enable CMP0144 policy if available, this will make the find_package()
more robust.

Signed-off-by: Jerry Zhang Jian <jerry.zhangjian@sifive.com>
  • Loading branch information
jerryzj authored Jul 1, 2024
1 parent 1b704e8 commit 9f3bfbb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmake/Modules/CMakePolicy.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit 9f3bfbb

Please sign in to comment.