cmake/Tests/RunCMake/cmake_path/check_errors.cmake

13 lines
337 B
CMake
Raw Normal View History

2021-09-14 00:13:48 +02:00
function (CHECK_ERRORS command)
set (errors ${ARGN})
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()