[CMake] "return" from a FIND package script?

Tyler Roscoe tyler at cryptio.net
Fri Jun 5 16:57:18 EDT 2009


On Fri, Jun 05, 2009 at 02:38:11PM -0600, James Bigler wrote:
> Is is possible to stop processing a FINDXYZ.cmake file with find_package
> without using a FATAL_ERROR?  I want to stop processing the file once I hit
> a snag, but not stop all of CMake processing.

This feels like kind of a dumb answer, but return()?

  return()

Returns from a file, directory or function. When this command is
encountered in an included file (via include() or find_package()), it
causes processing of the current file to stop and control is returned to
the including file.


That would be called from within FINDXYZ.cmake if it encountered a
problem. Are you asking how your calling CMakeLists (which does
include(FINDXYZ)) can stop processing the include file? I don't know if
that's possible.

tyler


More information about the CMake mailing list