Suggested patch for FindOpenGL.cmake

Paulo Moura Guedes moura at kdewebdev.org
Tue Jun 20 22:05:56 CEST 2006


On Tuesday 20 June 2006 20:34, David Faure wrote:
> On Tuesday 20 June 2006 21:26, Paulo Moura Guedes wrote:
> > You mean to add an if condition in FindX11.cmake? That would do it, but
> > just for X11...
>
> Yep, and I did something similar in many of the cmake modules in kde, at
> least those that use pkgconfig (whose output is not cached). The if()
> condition isn't always as simple as FOO_FOUND since that one doesn't get
> into the cache. So by testing e.g. FOO_LIBS and FOO_INCLUDES, I got two
> improvements: a fast path if calling FindFoo twice, but also a fast path
> when FindFoo can find its data in CMakeCache.txt.

Yes, that's clever ;)
So I would add that logic to the automated proposal. Before executing 
FindFoo.cmake instructions, cmake, through FIND_PACKAGE, would do something 
like this:

if(FOO_FOUND)
	return;
[else] if(FOO_LIBS and FOO_INCLUDES) {
	FOO_FOUND = true;
	return;
}
[else] execute FindFoo.cmake

With a flag in FIND_PACKAGE to disable this behavior.

Paulo


More information about the Kde-buildsystem mailing list