Suggested patch for FindOpenGL.cmake

Brad King brad.king at
Tue Jun 20 22:36:29 CEST 2006

Paulo Moura Guedes wrote:
> So I would add that logic to the automated proposal. Before executing 
> FindFoo.cmake instructions, cmake, through FIND_PACKAGE, would do something 
> like this:
> 	return;
> [else] if(FOO_LIBS and FOO_INCLUDES) {
> 	FOO_FOUND = true;
> 	return;

The assumption that FOO_LIBS and FOO_INCLUDES implies FOO_FOUND is too
strong to make in FIND_PACKAGE.  That will have to be done by the find
module itself because only the module knows what it means for FOO to be

The short-cut in FIND_PACKAGE for FOO_FOUND will be meant only to
prevent multiple calls to FIND_PACKAGE(FOO) from both having to process
all the code in FindFOO.cmake.  On the other hand if FOO was not found 
the first time the module was included why would it be found the second 

Instead we should just add include blockers around the whole find module:

   # ... rest of code ...

We cannot do this automatically in FIND_PACKAGE because some find 
modules may change their behavior based on variable settings and not 
want to have include blockers.


More information about the Kde-buildsystem mailing list