[CMake] EXIT() or RETURN() commands

Brad King brad.king at kitware.com
Thu Jun 15 10:16:58 EDT 2006


Filipe Sousa wrote:
> Hi,
> 
> I have some FindFoo.cmake scripts that uses big IF commands:
> 
> FIND_PROGRAM(FOO_EXEC ...)
> IF(FOO_EXEC)
>   # a lot of code
> ENDIF()
> 
> With a RETURN or EXIT command I could remove some nested code
> 
> FIND_PROGRAM(FOO_EXEC ...)
> IF(NOT FOO_EXEC)
>   RETURN() or EXIT()

MESSAGE(FATAL_ERRORO "Could not find FOO_EXEC.")

-Brad


More information about the CMake mailing list