vcpkg/scripts/cmake/vcpkg_prettify_command.cmake
Deadpikle 2ade39048c
[vcpkg] Fix prettify output not working in some cases (#12717)
If you changed VCPKG_TARGET_ARCHITECTURE to use x86_64, the prettify command failed to parse things properly. This was found during the changes made for #12657 and was completed by @strega-nil (thanks!).
2020-08-05 13:03:34 -07:00

27 lines
741 B
CMake

## # vcpkg_prettify_command
##
## Turns list of command arguments into a formatted string.
##
## ## Usage
## ```cmake
## vcpkg_prettify_command(<INPUT_VAR> <OUTPUT_VAR>)
## ```
##
## ## Examples
##
## * `scripts/cmake/vcpkg_execute_build_process.cmake`
## * `scripts/cmake/vcpkg_execute_required_process.cmake`
## * `scripts/cmake/vcpkg_execute_required_process_repeat.cmake`
macro(vcpkg_prettify_command INPUT_VAR OUTPUT_VAR)
set(${OUTPUT_VAR} "")
foreach(v ${${INPUT_VAR}})
if(v MATCHES "( )")
list(APPEND ${OUTPUT_VAR} "\"${v}\"")
else()
list(APPEND ${OUTPUT_VAR} "${v}")
endif()
endforeach()
list(JOIN ${OUTPUT_VAR} " " ${OUTPUT_VAR})
endmacro()