How to find qmake to find QT4

Bill Hoffman bill.hoffman at kitware.com
Wed Mar 22 20:37:45 CET 2006


At 02:07 PM 3/22/2006, you wrote:
>On Wednesday 22 March 2006 19:25, Michael Olbrich wrote:
>> On Wed, Mar 22, 2006 at 07:04:10PM +0100, Alexander Neundorf wrote:
>> > On Wednesday 22 March 2006 19:00, Michael Olbrich wrote:
>> > > I think that's part of the problem. What's the right(tm) way to install
>> > > qmake from qt3 and qt4? And I mean distribution packages not a separate
>> > > hand compiled tree. Like with any other library and tools I expect
>> > > headers in /usr/include libraries in /usr/lib and programs in /usr/bin.
>> > > Debian does just that. To avoid conflicts the programs get the suffix
>> > > "-qt3" or "-qt4". The original name is a link to one of the two
>> > > version. (btw, multiple versions of gcc or automake work like this
>> > > too).
>> >
>> > Do moc, uic, uic3 and rcc also all have the "-qt4" suffix on your system
>> > ?
>>
>> Unfortunately the rule is a bit more complex: Only programs that also
>> exist in qt3 have the suffix.
>>
>> qt4:
>> qmake-qt4
>> uic-qt4
>> moc-qt4
>> rcc
>> uic3
>
>
>Ok, committed, both to trunk and the snapshot.


To make sure qmake is found before qmake-qt4 you would have to
do this:

FIND_PROGRAM(QT_QMAKE_EXECUTABLE NAMES  qmake PATHS
  "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\4.0.0;InstallDir]/bin"
  "[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\4.0.0;InstallDir]/bin"
  $ENV{QTDIR}/bin
)

if(QT_QMAKE_EXECUTABLE)
  if(not correct version)
    set QT_QMAKE NOTFOUND)

FIND_PROGRAM(QT_QMAKE_EXECUTABLE NAMES  qmake-qt4 PATHS
  "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\4.0.0;InstallDir]/bin"
  "[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\4.0.0;InstallDir]/bin"
  $ENV{QTDIR}/bin
)

cmake looks for each name in all the paths.

-Bill



More information about the Kde-buildsystem mailing list