Files
CMake/Tests/RunCMake/cmake_path/check_errors.cmake
2020-09-06 10:52:25 +02:00

13 lines
337 B
CMake

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()