Skip to content

Commit

Permalink
Explicitly set CMake policy 0169 to silence warning
Browse files Browse the repository at this point in the history
The recommended `FetchContent_MakeAvailable()` is introduced in CMake
3.14 which is greater than `cmake_minimum_required()`.

CMake policy will effects subdirectories.

The `cmake_minimum_required(VERSION)` command implicitly calls
`cmake_policy(VERSION)`.

Closes #1788
  • Loading branch information
FantasqueX authored and Dead2 committed Sep 27, 2024
1 parent b80eb4c commit 8d10c30
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ else()
endif()
message(STATUS "Using CMake version ${CMAKE_VERSION}")

if(POLICY CMP0169)
cmake_policy(SET CMP0169 OLD) # CMake 3.30: call FetchContent_Populate() with just the name of a dependency
endif()

# If not specified on the command line, enable C11 as the default
# Configuration items that affect the global compiler environment standards
# should be issued before the "project" command.
Expand Down
2 changes: 0 additions & 2 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
cmake_minimum_required(VERSION 3.5.1)

macro(configure_test_executable target)
target_include_directories(${target} PRIVATE ${PROJECT_BINARY_DIR} ${PROJECT_SOURCE_DIR})
set_target_properties(${target} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
Expand Down

0 comments on commit 8d10c30

Please sign in to comment.