[CMake] Option to halt on first error?

Dan Kegel dank at kegel.com
Tue Jul 21 13:26:40 EDT 2015


A user was confused just now by cmake continuing to output lots and
lots of stuff after
an error.  How can we convince cmake to stop immediately upon first error?

The error in this case was

CMake Error at CMakeLists.txt:690 (add_executable):
  add_executable cannot create target "ImageClotTest" because another target
  with the same name already exists.  The existing target is an executable
  created in source directory
  "/Users/buildbot/slave-state/osx107/g-speak-rbb-osx107-1/yovo-osx107-iz/build/libBasement/tests".
  See documentation for policy CMP0002 for more details.
Call Stack (most recent call first):
  libMedia/tests/CMakeLists.txt:15 (generate_tests)

Something like
  SET(CMAKE_ALL_ERRORS_FATAL TRUE)
that caused cmake to immediately stop processing after outputting an
error would be great.

Presumably it exists, but I haven't found it yet...?


More information about the CMake mailing list