Skip to content

Commit 5e95839

Browse files
committed
cmake: Fix warning with CMP0177 policy
1 parent 8d71664 commit 5e95839

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

CMakeLists.txt

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,26 @@ option(SUFFIX_SO_VERSION "Suffix library name with its version" OFF)
6868
option(BUILD_TESTING_SCIPY
6969
"Build the SciPy tests (scipy should be installed on the machine)" ON)
7070

71+
# ----------------------------------------------------
72+
# --- Policy -----------------------------------------
73+
# CMake Policy setup
74+
# ----------------------------------------------------
75+
# Policy can be removed when cmake_minimum_required is updated.
76+
77+
# We also set CMAKE_POLICY_DEFAULT_CMPXXXX because CMake modules can reset
78+
# policy and redefine some macros like `find_dependency` that will not use our
79+
# policy.
80+
7181
# Use BoostConfig module distributed by boost library instead of using FindBoost
72-
# module distributed by CMake
82+
# module distributed by CMake (to remove in 3.30).
7383
if(POLICY CMP0167)
7484
cmake_policy(SET CMP0167 NEW)
85+
set(CMAKE_POLICY_DEFAULT_CMP0167 NEW)
86+
endif()
87+
# install() DESTINATION paths are normalized (to remove in 3.31).
88+
if(POLICY CMP0177)
89+
cmake_policy(SET CMP0177 NEW)
90+
set(CMAKE_POLICY_DEFAULT_CMP0177 NEW)
7591
endif()
7692
include("${JRL_CMAKE_MODULES}/base.cmake")
7793
compute_project_args(PROJECT_ARGS LANGUAGES CXX)

0 commit comments

Comments
 (0)