mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-10-08 23:44:00 +03:00
FetchContent: Update policy settings to CMake 4.1
The warning for policy CMP0174 can be triggered if a project mistakenly specifies CONFIGURE_COMMAND, BUILD_COMMAND, INSTALL_COMMAND, or TEST_COMMAND as keywords to FetchContent_Declare() and it passes an empty string after the keyword. It shouldn't be specifying any of those keywords, but doing so has always worked because FetchContent_Declare() explicitly discards them. However, when a project specifies them, they get used internally in contexts where the policy settings are those of the FetchContent module itself. Those settings haven't been updated past CMake 3.29, and CMP0174 came in with CMake 3.31. Update the policy settings for FetchContent to avoid triggering the CMP0174 warning when a project erroneously specifies the prohibited keywords. Fixes: #27157
This commit is contained in:
2 files changed
+2
-2
No files matched your search
@@ -1,4 +1,4 @@
|
|||||||
cmake_policy(VERSION 3.25)
|
cmake_policy(VERSION 4.1)
|
||||||
|
|
||||||
# Determine the remote URL of the project containing the working_directory.
|
# Determine the remote URL of the project containing the working_directory.
|
||||||
# This will leave output_variable unset if the URL can't be determined.
|
# This will leave output_variable unset if the URL can't be determined.
|
||||||
|
|||||||
@@ -1138,7 +1138,7 @@ current working directory.
|
|||||||
# FetchContent_MakeAvailable() implementation details are excluded for
|
# FetchContent_MakeAvailable() implementation details are excluded for
|
||||||
# backward compatibility reasons (see just after the endblock()).
|
# backward compatibility reasons (see just after the endblock()).
|
||||||
block(SCOPE_FOR POLICIES)
|
block(SCOPE_FOR POLICIES)
|
||||||
cmake_policy(VERSION 3.29)
|
cmake_policy(VERSION 4.1)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/ExternalProject/shared_internal_commands.cmake)
|
include(${CMAKE_CURRENT_LIST_DIR}/ExternalProject/shared_internal_commands.cmake)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user