mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-10-06 04:03:27 +03:00
CPack.cmake: reduce foreach iterations count matching CPACK* vars
This commit is contained in:
1 file changed
+8
-9
+8
-9
@@ -554,16 +554,15 @@ endmacro()
|
||||
function(cpack_encode_variables)
|
||||
set(commands "")
|
||||
get_cmake_property(res VARIABLES)
|
||||
foreach(var ${res})
|
||||
if(var MATCHES "^CPACK")
|
||||
if(CPACK_VERBATIM_VARIABLES)
|
||||
_cpack_escape_for_cmake(value "${${var}}")
|
||||
else()
|
||||
set(value "${${var}}")
|
||||
endif()
|
||||
|
||||
string(APPEND commands "\nset(${var} \"${value}\")")
|
||||
list(FILTER res INCLUDE REGEX "^CPACK")
|
||||
foreach(var IN LISTS res)
|
||||
if(CPACK_VERBATIM_VARIABLES)
|
||||
_cpack_escape_for_cmake(value "${${var}}")
|
||||
else()
|
||||
set(value "${${var}}")
|
||||
endif()
|
||||
|
||||
string(APPEND commands "\nset(${var} \"${value}\")")
|
||||
endforeach()
|
||||
|
||||
set(_CPACK_OTHER_VARIABLES_ "${commands}" PARENT_SCOPE)
|
||||
|
||||
Reference in new issue
Block a user