2020-12-02 05:37:26 +08:00
|
|
|
#[===[.md:
|
|
|
|
# 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`
|
|
|
|
#]===]
|
2019-07-02 04:30:24 +08:00
|
|
|
|
|
|
|
macro(vcpkg_prettify_command INPUT_VAR OUTPUT_VAR)
|
|
|
|
set(${OUTPUT_VAR} "")
|
|
|
|
foreach(v ${${INPUT_VAR}})
|
2020-08-06 04:03:34 +08:00
|
|
|
if(v MATCHES "( )")
|
|
|
|
list(APPEND ${OUTPUT_VAR} "\"${v}\"")
|
2019-07-02 04:30:24 +08:00
|
|
|
else()
|
2020-08-06 04:03:34 +08:00
|
|
|
list(APPEND ${OUTPUT_VAR} "${v}")
|
2019-07-02 04:30:24 +08:00
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
list(JOIN ${OUTPUT_VAR} " " ${OUTPUT_VAR})
|
|
|
|
endmacro()
|