Please test: changes in how Qt4 is found

William A. Hoffman billlist at nycap.rr.com
Fri Apr 28 22:16:03 BST 2006


At 04:19 PM 4/28/2006, Thiago Macieira wrote:
>William A. Hoffman wrote:
>>Is that the Trolltech recommended way for windows and the Mac?
>>If Trolltech required that pkg-config be installed before QT could
>>be used on any platform, I would have no problem using it.
>
>Qt doesn't require anything found with pkg-config to build. It's pointless 
>to require a program that won't be used in the build.
>
>But we do recommend using pkg-config for finding Qt/X11. Not qmake. qmake 
>is a separate program that doesn't have to be installed to use or develop 
>with Qt.

That is a surprise.    I thought that qt used qmake as part of its own
build process, and put qmake into the bin directory when qt was installed.



>So, in other words: Qt4 and its headers may be installed but not qmake. If 
>the Qt libraries and headers are installed, so are the .pc files.
>
>>But, that does not seem to be the case, unless I am missing
>>something?   So, what do the Trolls say should be done if
>>pkg-config is not found?  
>
>Bail out and say "install pkg-config". At least on Qt/X11.
>
>And alternative approach would be for cmake to read the .pc files 
>directly.



>>I am sure many Trolltech customers 
>>on windows do not have pkg-config and are happily using Qt,
>>I am assuming the answer is use qmake, which is what we are doing.
>
>Windows users have bigger issues. How do you find libz? How do you find 
>other libraries?
>
>Most of our Windows-only users don't care about qmake. They use 
>Microsoft's tools and that's it. At most, they use the Visual Studio 
>integration and generate the project files with qmake, then stop using 
>qmake.

Cross platform (Windows/Linux projects) most likely depend on qmake to
get things right.   So, what about Windows/Linux users?  


>>1. find qmake in the PATH
>>2. use pkg-config to find qmake
>>3. if 1 and 2 are the same qmake, then use the info from pkg-config
>>4. if pkg-config was not found, or it points to a different qmake than
>>the one in the users PATH, then use qmake to setup the paths for the
>> build.
>
>Use pkg-config to find qmake? Why? If pkg-config is found, ask it where 
>QtCore is, what its CXXFLAGS are, what the rpath flags are, where moc, 
>uic, etc. are.

So, if someone builds qt, then puts that qt bin their PATH, but does
not set the pkg-config environment variable, they will get the wrong
qt if there are two on the system.  Can pkg-config handle more than
one build of QT?  

I really just want this to work for the most possible cases across as
many platforms as possible. 


-Bill



More information about the kde-core-devel mailing list