[CMake] What to cache and what not

Alexander Neundorf a.neundorf-work at gmx.net
Sun Oct 19 19:04:49 EDT 2008


On Saturday 18 October 2008, Andreas Pakulat wrote:
> On 18.10.08 18:01:51, Alexander Neundorf wrote:
> > On Saturday 18 October 2008, Andreas Pakulat wrote:
> > > Hi,
> > >
> > > I'm a bit confused from readme.txt in the Modules directory, regarding
> > > which variables in a FindFoo.cmake or in my case FooConfig.cmake should
> > > be cached.
> > >
> > > I'm going to provide a Foo_INCLUDE_DIR and a couple of Foo_LIBX_LIBRARY
> > > variables and I'm wondering wether I should cache both or not?
> >
> > If coming from a FooConfig.cmake file I'd say they don't hae to go into
> > the cache (just IMO).
> > The cache helps avoiding searching the disk (not the case here) and
> > enables the user to adjust the settings if not found correctly
> > automatically (doesn't apply with FooConfig.cmake I'd say).
>
> Hmm, well thats true for the include-dir which is indeed just set().
> However for the libraries I still need the find_library call (using PATHS
> right now, but will switch to HINTS when cmake 2.6.2 is required for KDE)

You should be able to use just the one path you know together with 
NO_DEFAULT_PATH (since you know in the Config file where your libs are).
But yes, this will end up in the cache.

Alex


More information about the CMake mailing list