[CMake] FindQt - weird behavior

Clinton Stimpson clinton at elemtech.com
Mon Aug 4 10:59:06 EDT 2008


On Aug 4, 2008, at 8:34 AM, Vitor Vasconcelos Araujo Silva wrote:

> 	Hello guys,
>
> 	I have one project is compiling and linking propertly.
> 	When I tried to include this project in a bigger project, it's not  
> correctly linking.
>
> 	I generated both using CMAKE_VERBOSE_MAKEFILE:bool=true and I  
> eliminated all differences in the compile and link commands, but  
> one : one project finds:
>
>
> Part of CMakeCache entry of project working
> ---------------------------------------------------------------------- 
> ---
> //Path to a file.
> QT_QTXML_INCLUDE_DIR:PATH=C:/Qt/4.3.0/include/QtXml
>
> //The Qt QTXML library
> QT_QTXML_LIBRARY:FILEPATH=C:/Qt/4.3.0/lib/libQtXml4.a
>
> //Path to a library.
> QT_QTXML_LIBRARY_DEBUG:FILEPATH=C:/Qt/4.3.0/lib/libQtXmld4.a
>
> //Path to a library.
> QT_QTXML_LIBRARY_RELEASE:FILEPATH=C:/Qt/4.3.0/lib/libQtXml4.a
>
>
>
> Part of CMakeCache entry of project NOT working
> ---------------------------------------------------------------------- 
> ----
> //Path to a file.
> QT_QTXML_INCLUDE_DIR:PATH=C:/Qt/4.3.0/include/QtXml
>
> //The Qt QTXML library
> QT_QTXML_LIBRARY:FILEPATH=C:/Qt/4.3.0/lib/libQtXml.a
>
> //Path to a library.
> QT_QTXML_LIBRARY_DEBUG:FILEPATH=C:/Qt/4.3.0/lib/libQtXmld4.a
>
> //Path to a library.
> QT_QTXML_LIBRARY_RELEASE:FILEPATH=C:/Qt/4.3.0/lib/libQtXml.a
>
> 	
> 	As you can see, the QT_QTXML_LIBRARY_RELEASE variable points to  
> different Qt libraries. If I changed manually in the CMakeCache.txt  
> file the variable to libQtXml4.a everything work.
>
> 	If I try to print its contents using MESSAGE($ 
> {QT_QTXML_LIBRARY_RELEASE}) both projects strangely show libQtXml.a.
>
> 	Anybody has this problem? I'm using CMake for almost two years and  
> it's the first time I see this. I'm betting my Qt install is not  
> standard.

Did you build both static and shared Qt and install it in the same  
place?
That would produce a bad install of Qt.  That might explain why you  
have both libQtXml.a and libQtXml4.a

Clint




More information about the CMake mailing list