aboutsummaryrefslogtreecommitdiff
path: root/scripts/cmake/vcpkg_prettify_command.cmake
diff options
context:
space:
mode:
authorLeonid Pospelov <pospelovlm@yandex.ru>2019-07-01 22:30:24 +0200
committerVictor Romero <romerosanchezv@gmail.com>2019-07-01 13:30:24 -0700
commitb26cb1a041177ab113c723d89a4ef2af5614a9e5 (patch)
tree969f6e1da79c2610a8ba540ea00dda31c7a78c52 /scripts/cmake/vcpkg_prettify_command.cmake
parent77cfd20b83e71a0c513658e7c4d049d4039905af (diff)
downloadvcpkg-b26cb1a041177ab113c723d89a4ef2af5614a9e5.tar.gz
vcpkg-b26cb1a041177ab113c723d89a4ef2af5614a9e5.zip
[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
Diffstat (limited to 'scripts/cmake/vcpkg_prettify_command.cmake')
-rw-r--r--scripts/cmake/vcpkg_prettify_command.cmake26
1 files changed, 26 insertions, 0 deletions
diff --git a/scripts/cmake/vcpkg_prettify_command.cmake b/scripts/cmake/vcpkg_prettify_command.cmake
new file mode 100644
index 000000000..9d9a2b798
--- /dev/null
+++ b/scripts/cmake/vcpkg_prettify_command.cmake
@@ -0,0 +1,26 @@
+## # 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()