mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
Generalize the fix in commit v3.11.0-rc4~8^2 (ExternalProject: Fix cache generation when last args ends with "-NOTFOUND", 2018-03-10) to work for any argument rather than just the last one. ExternalProject can now successfully generate the cache file when any (not only the last one) cache variable associated with either `CMAKE_CACHE_ARGS` or `CMAKE_DEFAULT_CACHE_ARGS` configure step option is set to a `<value>` ending with `-NOTFOUND`.
14 lines
599 B
CMake
14 lines
599 B
CMake
get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
|
if(NOT _isMultiConfig)
|
|
set(CMAKE_BUILD_TYPE Debug)
|
|
endif()
|
|
include(ExternalProject)
|
|
|
|
ExternalProject_Add(FOO TMP_DIR "${CMAKE_CURRENT_BINARY_DIR}/tmp"
|
|
DOWNLOAD_COMMAND ""
|
|
CMAKE_CACHE_DEFAULT_ARGS
|
|
"-DFOO:STRING=$<1:BAR>$<0:BAD>"
|
|
"-DTEST_LIST:STRING=A;B;C"
|
|
"-DTEST_OPTIONAL:FILEPATH=TEST_OPTIONAL-NOTFOUND"
|
|
"-DTEST_OPTIONAL_LAST:FILEPATH=TEST_OPTIONAL_LAST-NOTFOUND")
|