Files
CMake/Tests/RunCMake/CMP0170/CMP0170.cmake
T
Craig Scott f588421b58 FetchContent: Enforce FETCHCONTENT_FULLY_DISCONNECTED requirements
FETCHCONTENT_FULLY_DISCONNECTED should only be set to true if
each dependency's source directory has already been populated.
Previously, this wasn't being checked, but now it is (subject to a new
policy).
2024-05-29 20:39:17 +10:00

19 lines
478 B
CMake

cmake_policy(SET CMP0168 NEW) # Faster, don't need to test with sub-build
cmake_policy(SET CMP0169 OLD) # So we can test FetchContent_Populate() directly
set(FETCHCONTENT_FULLY_DISCONNECTED TRUE)
include(FetchContent)
message(STATUS "Starting population")
FetchContent_Declare(t1
SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/IdoNotExist"
)
FetchContent_Populate(t1)
FetchContent_Declare(t2
SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/IdoNotExist"
)
FetchContent_MakeAvailable(t2)