vcpkg/scripts/cmake/vcpkg_prettify_command.cmake
Robert Schumacher 5deea3b975
[vcpkg-docs] Add documentation for vcpkg_configure_meson(), vcpkg_install_meson(), vcpkg_fixup_cmake_targts(), and vcpkg_prettify_command() (#7606)
* [vcpkg-docs] Add documentation for `vcpkg_configure_meson()`, `vcpkg_install_meson()`, `vcpkg_fixup_cmake_targts()`, and `vcpkg_prettify_command()`

* [docs] Address code review comments. Reformat docs for vcpkg_fail_port_install.
2020-02-12 15:58:43 -08:00

27 lines
740 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()