mirror of
https://github.com/cemu-project/vcpkg.git
synced 2025-02-04 02:38:49 +00:00
[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
This commit is contained in:
parent
77cfd20b83
commit
b26cb1a041
@ -32,3 +32,4 @@ include(vcpkg_get_windows_sdk)
|
|||||||
include(vcpkg_replace_string)
|
include(vcpkg_replace_string)
|
||||||
include(vcpkg_from_git)
|
include(vcpkg_from_git)
|
||||||
include(vcpkg_test_cmake)
|
include(vcpkg_test_cmake)
|
||||||
|
include(vcpkg_prettify_command)
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
## ## Examples
|
## ## Examples
|
||||||
##
|
##
|
||||||
## * [icu](https://github.com/Microsoft/vcpkg/blob/master/ports/icu/portfile.cmake)
|
## * [icu](https://github.com/Microsoft/vcpkg/blob/master/ports/icu/portfile.cmake)
|
||||||
|
include(vcpkg_prettify_command)
|
||||||
function(vcpkg_execute_build_process)
|
function(vcpkg_execute_build_process)
|
||||||
cmake_parse_arguments(_ebp "" "WORKING_DIRECTORY;LOGNAME" "COMMAND;NO_PARALLEL_COMMAND" ${ARGN})
|
cmake_parse_arguments(_ebp "" "WORKING_DIRECTORY;LOGNAME" "COMMAND;NO_PARALLEL_COMMAND" ${ARGN})
|
||||||
|
|
||||||
@ -131,8 +132,9 @@ function(vcpkg_execute_build_process)
|
|||||||
file(TO_NATIVE_PATH "${LOG}" NATIVE_LOG)
|
file(TO_NATIVE_PATH "${LOG}" NATIVE_LOG)
|
||||||
list(APPEND STRINGIFIED_LOGS " ${NATIVE_LOG}\n")
|
list(APPEND STRINGIFIED_LOGS " ${NATIVE_LOG}\n")
|
||||||
endforeach()
|
endforeach()
|
||||||
|
vcpkg_prettify_command(_ebp_COMMAND _ebp_COMMAND_PRETTY)
|
||||||
message(FATAL_ERROR
|
message(FATAL_ERROR
|
||||||
" Command failed: ${_ebp_COMMAND}\n"
|
" Command failed: ${_ebp_COMMAND_PRETTY}\n"
|
||||||
" Working Directory: ${_ebp_WORKING_DIRECTORY}\n"
|
" Working Directory: ${_ebp_WORKING_DIRECTORY}\n"
|
||||||
" See logs for more information:\n"
|
" See logs for more information:\n"
|
||||||
${STRINGIFIED_LOGS})
|
${STRINGIFIED_LOGS})
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
## * [openssl](https://github.com/Microsoft/vcpkg/blob/master/ports/openssl/portfile.cmake)
|
## * [openssl](https://github.com/Microsoft/vcpkg/blob/master/ports/openssl/portfile.cmake)
|
||||||
## * [boost](https://github.com/Microsoft/vcpkg/blob/master/ports/boost/portfile.cmake)
|
## * [boost](https://github.com/Microsoft/vcpkg/blob/master/ports/boost/portfile.cmake)
|
||||||
## * [qt5](https://github.com/Microsoft/vcpkg/blob/master/ports/qt5/portfile.cmake)
|
## * [qt5](https://github.com/Microsoft/vcpkg/blob/master/ports/qt5/portfile.cmake)
|
||||||
|
include(vcpkg_prettify_command)
|
||||||
function(vcpkg_execute_required_process)
|
function(vcpkg_execute_required_process)
|
||||||
cmake_parse_arguments(vcpkg_execute_required_process "" "WORKING_DIRECTORY;LOGNAME" "COMMAND" ${ARGN})
|
cmake_parse_arguments(vcpkg_execute_required_process "" "WORKING_DIRECTORY;LOGNAME" "COMMAND" ${ARGN})
|
||||||
set(LOG_OUT "${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_LOGNAME}-out.log")
|
set(LOG_OUT "${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_LOGNAME}-out.log")
|
||||||
@ -53,8 +54,9 @@ function(vcpkg_execute_required_process)
|
|||||||
file(TO_NATIVE_PATH "${LOG}" NATIVE_LOG)
|
file(TO_NATIVE_PATH "${LOG}" NATIVE_LOG)
|
||||||
list(APPEND STRINGIFIED_LOGS " ${NATIVE_LOG}\n")
|
list(APPEND STRINGIFIED_LOGS " ${NATIVE_LOG}\n")
|
||||||
endforeach()
|
endforeach()
|
||||||
|
vcpkg_prettify_command(vcpkg_execute_required_process_COMMAND vcpkg_execute_required_process_COMMAND_PRETTY)
|
||||||
message(FATAL_ERROR
|
message(FATAL_ERROR
|
||||||
" Command failed: ${vcpkg_execute_required_process_COMMAND}\n"
|
" Command failed: ${vcpkg_execute_required_process_COMMAND_PRETTY}\n"
|
||||||
" Working Directory: ${vcpkg_execute_required_process_WORKING_DIRECTORY}\n"
|
" Working Directory: ${vcpkg_execute_required_process_WORKING_DIRECTORY}\n"
|
||||||
" Error code: ${error_code}\n"
|
" Error code: ${error_code}\n"
|
||||||
" See logs for more information:\n"
|
" See logs for more information:\n"
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
# Usage: vcpkg_execute_required_process_repeat(COUNT <num> COMMAND <cmd> [<args>...] WORKING_DIRECTORY </path/to/dir> LOGNAME <my_log_name>)
|
# Usage: vcpkg_execute_required_process_repeat(COUNT <num> COMMAND <cmd> [<args>...] WORKING_DIRECTORY </path/to/dir> LOGNAME <my_log_name>)
|
||||||
|
include(vcpkg_prettify_command)
|
||||||
function(vcpkg_execute_required_process_repeat)
|
function(vcpkg_execute_required_process_repeat)
|
||||||
cmake_parse_arguments(vcpkg_execute_required_process_repeat "" "COUNT;WORKING_DIRECTORY;LOGNAME" "COMMAND" ${ARGN})
|
cmake_parse_arguments(vcpkg_execute_required_process_repeat "" "COUNT;WORKING_DIRECTORY;LOGNAME" "COMMAND" ${ARGN})
|
||||||
#debug_message("vcpkg_execute_required_process_repeat(${vcpkg_execute_required_process_repeat_COMMAND})")
|
#debug_message("vcpkg_execute_required_process_repeat(${vcpkg_execute_required_process_repeat_COMMAND})")
|
||||||
@ -18,8 +19,9 @@ function(vcpkg_execute_required_process_repeat)
|
|||||||
endif()
|
endif()
|
||||||
endforeach(loop_count)
|
endforeach(loop_count)
|
||||||
if (NOT SUCCESSFUL_EXECUTION)
|
if (NOT SUCCESSFUL_EXECUTION)
|
||||||
|
vcpkg_prettify_command(vcpkg_execute_required_process_repeat_COMMAND vcpkg_execute_required_process_repeat_COMMAND_PRETTY)
|
||||||
message(FATAL_ERROR
|
message(FATAL_ERROR
|
||||||
" Command failed: ${vcpkg_execute_required_process_repeat_COMMAND}\n"
|
" Command failed: ${vcpkg_execute_required_process_repeat_COMMAND_PRETTY}\n"
|
||||||
" Working Directory: ${vcpkg_execute_required_process_repeat_WORKING_DIRECTORY}\n"
|
" Working Directory: ${vcpkg_execute_required_process_repeat_WORKING_DIRECTORY}\n"
|
||||||
" See logs for more information:\n"
|
" See logs for more information:\n"
|
||||||
" ${NATIVE_BUILDTREES_DIR}\\${vcpkg_execute_required_process_repeat_LOGNAME}-out.log\n"
|
" ${NATIVE_BUILDTREES_DIR}\\${vcpkg_execute_required_process_repeat_LOGNAME}-out.log\n"
|
||||||
|
26
scripts/cmake/vcpkg_prettify_command.cmake
Normal file
26
scripts/cmake/vcpkg_prettify_command.cmake
Normal file
@ -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()
|
Loading…
x
Reference in New Issue
Block a user