diff options
author | Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com> | 2018-03-10 09:29:50 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-03-12 17:45:50 (GMT) |
commit | 7ad981c8f705ef563b8ca0bf3da98f6902fa56fe (patch) | |
tree | a3465ff8dec0f905cc05eecc0069608c7bfd17fa /Modules/ExternalProject.cmake | |
parent | c5541cf0da1093635fea7da5a40e64e481b5477e (diff) | |
download | CMake-7ad981c8f705ef563b8ca0bf3da98f6902fa56fe.zip CMake-7ad981c8f705ef563b8ca0bf3da98f6902fa56fe.tar.gz CMake-7ad981c8f705ef563b8ca0bf3da98f6902fa56fe.tar.bz2 |
ExternalProject: Fix cache generation when last args ends with "-NOTFOUND"
Diffstat (limited to 'Modules/ExternalProject.cmake')
-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}") |