[CMake] Custom message if target fails

Daniel Wirtz daniel.wirtz at simtech.uni-stuttgart.de
Thu Nov 12 03:54:09 EST 2015


Dear all,

i've been thinking on this for a while but i can't seem to get my head 
around how to solve this.
The task is simple: How can i display a custom error message if a target 
fails to build for whatever reason?
- cmake ..
- make
- <build starts, stuff goes wrong, error out>
- below the (compile-tool dependent error output) i'd like to print 
something like "Whoops it went wrong, type this and that or visit this 
or that website for help"

i know this should ALSO be in the documentation, but you know how people 
intuitively avoid reading those important parts :-)

any help/ideas are appreciated.

-- 
Dr. Daniel Wirtz
Dipl. Math. Dipl. Inf.
SRC SimTech
Pfaffenwaldring 5a
+49 711 685 60044



More information about the CMake mailing list