Skip to content

Commit 0630edc

Browse files
committed
added new cmake policy to improve finding packages using <PACKAGENAME>_ROOT
Signed-off-by: Sombrio <[email protected]>
1 parent 3197313 commit 0630edc

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

CMakeLists.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,18 @@ cmake_policy(SET CMP0078 NEW)
99
# Allows SWIG_MODULE_NAME to be set
1010
cmake_policy(SET CMP0086 NEW)
1111

12-
# Allows <PackageName>_ROOT to be used
12+
# CMP0074: Allows find_package to use <PackageName>_ROOT variables. This
13+
# policy was the original mechanism for letting users specify custom
14+
# dependency locations.
1315
cmake_policy(SET CMP0074 NEW)
1416

17+
# CMP0144: Standardizes the use of <PACKAGENAME>_ROOT (uppercase) variables
18+
# in find_package. Newer CMake modules rely on this policy for consistent
19+
# behavior. Setting both CMP0074 and CMP0144 ensures that both older and
20+
# newer find modules correctly respect custom dependency paths, which is
21+
# critical for builds in non-standard environments.
22+
cmake_policy(SET CMP0144 NEW)
23+
1524
# Allow AUTOUIC on generated source
1625
cmake_policy(SET CMP0071 NEW)
1726

0 commit comments

Comments
 (0)