Skip to content

Commit 8adc5b2

Browse files
committed
cmake: Fix warning with CMP0177 policy
1 parent d14a8a4 commit 8adc5b2

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

CMakeLists.txt

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,28 @@ endif()
6161
set(DOXYGEN_USE_MATHJAX YES)
6262
set(DOXYGEN_USE_TEMPLATE_CSS YES)
6363

64+
# ----------------------------------------------------
65+
# --- Policy -----------------------------------------
66+
# CMake Policy setup
67+
# ----------------------------------------------------
68+
# Policy can be removed when cmake_minimum_required is updated.
69+
70+
# We also set CMAKE_POLICY_DEFAULT_CMPXXXX because CMake modules can reset policy and redefine some
71+
# macros like `find_dependency` that will not use our policy.
72+
6473
# Use BoostConfig module distributed by boost library instead of using FindBoost module distributed
65-
# by CMake
74+
# by CMake (to remove in 3.30). This policy is not working when using clang-cl.
6675
if(NOT WIN32 OR NOT ${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
6776
if(POLICY CMP0167)
6877
cmake_policy(SET CMP0167 NEW)
78+
set(CMAKE_POLICY_DEFAULT_CMP0167 NEW)
6979
endif()
7080
endif()
81+
# install() DESTINATION paths are normalized (to remove in 3.31).
82+
if(POLICY CMP0177)
83+
cmake_policy(SET CMP0177 NEW)
84+
set(CMAKE_POLICY_DEFAULT_CMP0177 NEW)
85+
endif()
7186
include("${JRL_CMAKE_MODULES}/base.cmake")
7287

7388
compute_project_args(PROJECT_ARGS LANGUAGES CXX)

0 commit comments

Comments
 (0)