diff options
author | Craig Scott <craig.scott@crascit.com> | 2020-10-04 21:02:02 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-10-04 21:02:11 (GMT) |
commit | a771e2146a6954fd1ef6739fd4f73ef108cfe2bc (patch) | |
tree | 40ca94cd8f5059cd0531872ff8a67445fab73d5a /Modules | |
parent | 3ae3b352d1b67ec2ca8bce0a74a74381d05b9f04 (diff) | |
parent | b030a6af88a02b0237a00e6f3df4a5807f338823 (diff) | |
download | CMake-a771e2146a6954fd1ef6739fd4f73ef108cfe2bc.zip CMake-a771e2146a6954fd1ef6739fd4f73ef108cfe2bc.tar.gz CMake-a771e2146a6954fd1ef6739fd4f73ef108cfe2bc.tar.bz2 |
Merge topic 'FetchContent_missing_SOURCE_DIR'
b030a6af88 FetchContent: Raise error if manually given source dir does not exist
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5317
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FetchContent.cmake | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Modules/FetchContent.cmake b/Modules/FetchContent.cmake index acf2a94..40cc362 100644 --- a/Modules/FetchContent.cmake +++ b/Modules/FetchContent.cmake @@ -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}) |