vcpkg/scripts/cmake/vcpkg_prettify_command.cmake
Leonid Pospelov b26cb1a041 [vcpkg] Use spaces instead of semicolons in the output (#7080)
* Use spaces instead of semicolons in the output

* Add prettify_command macro

* Move pretty_command macro to a separate file
2019-07-01 13:30:24 -07:00

27 lines
716 B
CMake

## # vcpkg_prettify_command
##
## Turns list of command arguments into a formatted string.
##
## ## Usage
## ```cmake
## vcpkg_prettify_command()
## ```
##
## ## 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()