On Mon, Jul 7, 2008 at 8:41 AM, Bill Hoffman wrote:
> 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.

Yes, but usually one doesn't want to add the NO_CACHE variable,
because we want the user to specify it if we can't guess it or if we
guess it incorrectly. It is only for constrained situations which are
not the common case I guess.

> 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.

This is what I suggested in feature request:

http://public.kitware.com/Bug/view.php?id=7286

I think it would be useful to have this, but I still see value in the
NO_CACHE option.

> 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?

Hello Bill,

Try coding this with IF/ELSE EXISTS without knowing the version
number, of course (any example with several NAMES will demonstrate
what I mean):

find_library(wxWidgets_core_LIBRARY
  NAMES
    wxmsw29_core
    wxmsw28_core
    wxmsw27_core
    wxmsw26_core
    wxmsw25_core
  PATHS ${wxWidgets_LIB_DIR}
  NO_DEFAULT_PATH
  NO_CACHE
  )

Not to mention handling the .exe extension (find_program), the lib
prefix, the lib extension (.a, .so, etc), depending on the platform. I
mean the above will find:

wxmsw29_core.dll
wxmsw29_core.lib
libwxmsw29_core.a
libwxmsw29_core.so
etc.

I just think the find_XXX with NO_CACHE is much easier and expressive.
The find_xxx commands do a lot of work to handle these sort of things
that anyone trying to code this with the IF/ELSE structure would need
to understand for all platforms.

--Miguel
_______________________________________________
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to