mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-29 20:23:41 +08:00
545c165ce0
* [vcpkg_prettify_command] Audit * rename file * rename out-var in docs * fix file path * add internal use message to docs * escapin' in z_vcpkg_prettify_command_line * regenerate docs
34 lines
986 B
CMake
34 lines
986 B
CMake
#[===[.md:
|
|
# z_vcpkg_prettify_command_line
|
|
|
|
**Only for internal use in vcpkg helpers. Behavior and arguments will change without notice.**
|
|
Turn a command line into a formatted string.
|
|
|
|
```cmake
|
|
z_vcpkg_prettify_command_line(<out-var> <argument>...)
|
|
```
|
|
|
|
This command is for internal use, when printing out to a message.
|
|
|
|
## Examples
|
|
|
|
* `scripts/cmake/vcpkg_execute_build_process.cmake`
|
|
* `scripts/cmake/vcpkg_execute_required_process.cmake`
|
|
* `scripts/cmake/vcpkg_execute_required_process_repeat.cmake`
|
|
#]===]
|
|
|
|
function(z_vcpkg_prettify_command_line OUT_VAR)
|
|
set(OUTPUT "")
|
|
z_vcpkg_function_arguments(ARGS 1)
|
|
foreach(v IN LISTS ARGS)
|
|
string(REPLACE [[\]] [[\\]] v "${v}")
|
|
if(v MATCHES "( )")
|
|
string(REPLACE [["]] [[\"]] v "${v}")
|
|
list(APPEND OUTPUT "\"${v}\"")
|
|
else()
|
|
list(APPEND OUTPUT "${v}")
|
|
endif()
|
|
endforeach()
|
|
list(JOIN "${OUT_VAR}" " " OUTPUT)
|
|
endfunction()
|