check_errors.cmake 370 B

12345678910111213
  1. function (CHECK_ERRORS command)
  2. set (errors ${ARGN})
  3. set (command "$<${command}>")
  4. if (errors)
  5. string (LENGTH "${command}" length)
  6. math (EXPR count "${length} + 2")
  7. string (REPEAT " " ${count} shift)
  8. list (TRANSFORM errors PREPEND "${shift}$")
  9. list (JOIN errors "\n" msg)
  10. message (FATAL_ERROR "${command}: ${msg}")
  11. endif()
  12. endfunction()