[CMake] Patch: Add NO_CACHE option to find_xxx commands

Bill Hoffman bill.hoffman at kitware.com
Mon Jul 7 09:41:24 EDT 2008


Miguel A. Figueroa-Villanueva wrote:
> On Mon, Jul 7, 2008 at 2:04 AM, Enrico Scholz wrote:
>> "Miguel A. Figueroa-Villanueva" writes:
>>> I would like to propose the addition of a NO_CACHE keyword to the
>>> find_xxx commands that would treat <VAR> as a non-cached variable.
>> Better wolution would be the equivalent of autoconf's './config.status
>> --recheck', e.g. reinvoking cmake with empty cache but with original
>> configuration options.
> 
> This is not what we want. We want to keep the cache variables since
> the user might have changed it in the gui.
> 
> We just want some variables not to go into the cache (and hence not be
> presented in the gui), but they automatically make it to the cache
> because they are used in the find_xxx set of commands.
> 

There is one more down side to NO_CACHE.  It will mean that CMake will 
look for these libraries every time it runs.  If we did this with all 
modules things would get pretty slow.  I think what would be better is 
some sort of dependent variable scheme and internal cache variables that 
get cleared when the main variable changes.  When wxWidgets_LIB_DIR 
changes, then wxWidgets_core_LIBRARY should be looked up again.  Also, I 
assume that you do not want to allow the core library to be in a 
different directory than wxWidgets_LIB_DIR which would be the other 
effect.  However, if you always know where wxWidgets_core_LIBRARY is 
relative to wxWidgets_LIB_DIR, then why do you need to use find_library 
to find it?

-Bill

-- 
Bill Hoffman
Kitware, Inc.
28 Corporate Drive
Clifton Park, NY 12065
bill.hoffman at kitware.com
http://www.kitware.com
518-371-3971 (phone and fax)


More information about the CMake mailing list