mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-03 12:49:50 -05:00
FetchContent: Raise error if manually given source dir does not exist
Fixes: #21208
This commit is contained in:
@@ -1052,6 +1052,12 @@ function(FetchContent_Populate contentName)
|
||||
# The source directory has been explicitly provided in the cache,
|
||||
# so no population is required. The build directory may still be specified
|
||||
# by the declared details though.
|
||||
|
||||
if(NOT EXISTS "${FETCHCONTENT_SOURCE_DIR_${contentNameUpper}}")
|
||||
message(FATAL_ERROR "Manually specified source directory is missing:\n"
|
||||
" FETCHCONTENT_SOURCE_DIR_${contentNameUpper} --> ${FETCHCONTENT_SOURCE_DIR_${contentNameUpper}}")
|
||||
endif()
|
||||
|
||||
set(${contentNameLower}_SOURCE_DIR "${FETCHCONTENT_SOURCE_DIR_${contentNameUpper}}")
|
||||
|
||||
cmake_parse_arguments(savedDetails "" "BINARY_DIR" "" ${contentDetails})
|
||||
|
||||
Reference in New Issue
Block a user