[CMake] cache variable prevents FIND_LIBRARY to be called again :/
Bill Hoffman
bill.hoffman at kitware.com
Fri Nov 3 14:26:05 EST 2006
Alan W. Irwin wrote:
> On 2006-11-01 16:39-0500 Tristan Carel wrote:
>
>> On 11/1/06, Tristan Carel <tristan.carel at gmail.com> wrote:
>>> On 11/1/06, Brad King <brad.king at kitware.com> wrote:
>>> > SET(MYLIB)
>>> > FIND_LIBRARY(MYLIB ...)
>>>
>>> It doesn't seem to work, the cache value is not updated.
>> Ok it works if I set
>>
>> SET(PYTHON_LIBRARIES PYTHON_LIBRARIES-NOTFOUND)
>>
>> which is logic!
>>
>> Thanks to Brad & Alan
>
> Brad, would it be easier to treat all FALSE values the same way (as you
> assumed above)?
>
> What I mean by FALSE is the same things the IF(NOT variable) considers to
> be TRUE. According to the documentation that is
>
> "IF(NOT variable)
>
> True if the variable's value is empty, 0, N, NO, OFF, FALSE,
> NOTFOUND,
> or <variable>-NOTFOUND."
>
> As you found out, it can be confusing if FIND_XXX makes distinctions
> between
> these various kinds of FALSE values. Whatever the final decision on this
> issue, please make sure the documentation reflects that decision.
The NOTFOUND has to remain special for the FIND_XXX. It is in the
current CVS docs for
the command. The reason is you may want to set the variable to a FALSE
value that will stop the
FIND_XXX from looking for some reason. For example, I am running a
dashboard and I know there
is a bad version of some software on that machine, and for some reason I
can not fix that software.
I can preload the cache with the variable set to FALSE, and this will
keep the FIND_XXX stuff from
finding the bad software on the machine when cmake is run.
-Bill
More information about the CMake
mailing list