[CMake] How do I allow an ExternalProject to fail?

Nicholas Braden nicholas11braden at gmail.com
Sat Nov 14 01:10:54 EST 2015


I want to use ExternalProject_Add to download a git repository and try
to compile it, and allow it to fail so I can either fall back on
another method or disable certain functionality in my project. It
looks like try_compile can try to compile a whole project, but I am
not sure of an easy way to use this with ExternalProject_Add - I want
CMake to automatically download and update the git repository and try
to rebuild it again when there are changes, if possible.

What would be the best way to go about doing this? I am using CMake 3.4.0

Thanks,
Nicholas Braden


More information about the CMake mailing list