[CMake] Check if a command exists?

Mathias Gaunard mathias.gaunard at ens-lyon.org
Tue Sep 4 04:11:53 EDT 2012


On 03/09/2012 21:59, Rui Maciel wrote:
> I have a small project which includes a couple of parsers whose lexers
> are generated by re2c.  I intended to set cmake so that it could check
> if re2c is present in the system, but after browsing through the docs
> I've ended up empty-handed.
>
> So, is there a way to set a cmake project so that it checks if a
> tool/program/command is present in the build system?  If there is a way
> to run that check, can anyone provide an example?

find_program(RE2C_EXECUTABLE re2c)



More information about the CMake mailing list