diff options
author | Brad King <brad.king@kitware.com> | 2018-03-12 17:49:39 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-03-12 17:49:44 (GMT) |
commit | 83071fff759f27f18922df8336826f19518e730c (patch) | |
tree | 0e0bb11ee0316418ce4cd85f4676744c430e345b /Modules | |
parent | 378a11cdbad6732971e91d5999f5788e26e35438 (diff) | |
parent | 7ad981c8f705ef563b8ca0bf3da98f6902fa56fe (diff) | |
download | CMake-83071fff759f27f18922df8336826f19518e730c.zip CMake-83071fff759f27f18922df8336826f19518e730c.tar.gz CMake-83071fff759f27f18922df8336826f19518e730c.tar.bz2 |
Merge topic 'ep-support-passing-var-ending-with-notfound'
7ad981c8f7 ExternalProject: Fix cache generation when last args ends with "-NOTFOUND"
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1838
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/ExternalProject.cmake | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index 30176bb..db19691 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -1707,7 +1707,7 @@ function(_ep_command_line_to_initial_cache var args force) endif() endforeach() # Catch the final line of the args - if(setArg) + if(NOT "${setArg}" STREQUAL "") string(APPEND setArg "${accumulator}\" CACHE ${type} \"Initial cache\" ${forceArg})") string(APPEND script_initial_cache "\n${setArg}") endif() @@ -2750,12 +2750,22 @@ function(_ep_extract_configure_command var name) get_property(cmake_cache_args TARGET ${name} PROPERTY _EP_CMAKE_CACHE_ARGS) get_property(cmake_cache_default_args TARGET ${name} PROPERTY _EP_CMAKE_CACHE_DEFAULT_ARGS) - if(cmake_cache_args OR cmake_cache_default_args) + set(has_cmake_cache_args 0) + if(NOT "${cmake_cache_args}" STREQUAL "") + set(has_cmake_cache_args 1) + endif() + + set(has_cmake_cache_default_args 0) + if(NOT "${cmake_cache_default_args}" STREQUAL "") + set(has_cmake_cache_default_args 1) + endif() + + if(has_cmake_cache_args OR has_cmake_cache_default_args) set(_ep_cache_args_script "<TMP_DIR>/${name}-cache-$<CONFIG>.cmake") - if(cmake_cache_args) + if(has_cmake_cache_args) _ep_command_line_to_initial_cache(script_initial_cache_force "${cmake_cache_args}" 1) endif() - if(cmake_cache_default_args) + if(has_cmake_cache_default_args) _ep_command_line_to_initial_cache(script_initial_cache_default "${cmake_cache_default_args}" 0) endif() _ep_write_initial_cache(${name} "${_ep_cache_args_script}" "${script_initial_cache_force}${script_initial_cache_default}") |