diff options
Diffstat (limited to 'Tests/RunCMake/GenEx-PATH/check_errors.cmake')
-rw-r--r-- | Tests/RunCMake/GenEx-PATH/check_errors.cmake | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Tests/RunCMake/GenEx-PATH/check_errors.cmake b/Tests/RunCMake/GenEx-PATH/check_errors.cmake new file mode 100644 index 0000000..7e60fc7 --- /dev/null +++ b/Tests/RunCMake/GenEx-PATH/check_errors.cmake @@ -0,0 +1,13 @@ + +function (CHECK_ERRORS command) + set (errors ${ARGN}) + set (command "$<${command}>") + if (errors) + string (LENGTH "${command}" length) + math (EXPR count "${length} + 2") + string (REPEAT " " ${count} shift) + list (TRANSFORM errors PREPEND "${shift}") + list (JOIN errors "\n" msg) + message (FATAL_ERROR "${command}: ${msg}") + endif() +endfunction() |