[CMake] Re: FindQt4 in 2.4.8 bug

Bill Hoffman bill.hoffman at kitware.com
Thu Jan 31 13:41:01 EST 2008


Fernando Cacciola wrote:
> Fernando Cacciola wrote:
>> Hi,
>>
>> I've been using 2.4.7 until this morning when I saw the 2.4.8 
>> announcement
>> and jumped right away to install it (silly me).
>>
>> I have some script that finds Qt4 but stopped working on 2.4.8.
>>
>> Tracing the problem in FindQt4.cmake I found this...
>>
>> There is one (at least one) SET command like this:
>>
>>     SET( QT_INCLUDE_DIR ${qt4_include_dir} CACHE PATH "")
>>
>> which fails to actually set the value of QT_INCLUDE_DIR
>>
>> It works fine if DOCSTRING is prepended in front of  "":
>>
>> SET( QT_INCLUDE_DIR ${qt4_include_dir} CACHE PATH DOCSTRING "")
>>
> I just realized that the trailing "" in the original is the DOCSTRING 
> already.
> 
> My version works because the presence of my own trailing "" causes the 
> set command not to parse CACHE correctly, so it just adds "CACHE", 
> "PATH" and "DOCSTRING" to the variable (whith the value of 
> qt4_include_dir as the first element on the list)
> 
> Since that showned that this behaviour is related to caching the just 
> assigned value in the cache, I tried simply adding FORCE at the end, and 
> it worked.
> 
> Removing the cache still doesn't help unless I add FORCE, so is not an 
> issue caused by a previous value.
> Running the script a second time (so the cache contains 
> "QT_INCLUDE_DIR-NOT_FOUND") still doesn't change anything.
> 
> Any ideas?
> 
> 
Can you add a :

message(" ${qt4_include_dir} ") right before the set statement?
Also, what is the value of QT_QTCORE_INCLUDE_DIR?  You also did not say 
exactly what went wrong?  Did you get an error?  What is the value of 
QT_INCLUDE_DIR in your cache?

-Bill


More information about the CMake mailing list