Originally Posted by
theLSB
That is strange.
Mine uses QTDIR , not hard coded, as can be seen from the first build line:
Do you use a vanilla kdevelop or an rpm from some distro? Besides, /usr/lib/qt3 is one of the hardcoded paths to look for Qt (as among other, mdk uses it).
QTDIR="/usr/lib/qt3" gmake -k -j1 clean
Try setting a custom QTDIR before running KDevelop and it'll still use /usr/lib/qt3. It's because it sets QTDIR on its own, overriding all that has been set before. So the only way I found to make KDevelop (or rather TrollProjectPart) compile using Qt4 is to put Qt4 qmake in front of Qt3 qmake in $PATH.
I'm just rebuilding KDevelop rpm, so I have its sources with me:
bool TrollProjectPart::isValidQtDir( const QString& path ) const
{
return QFile::exists( path
+ "/include/qt.h" );
}
QStringList TrollProjectPart
::availableQtDirList() const {
qtdirs.push_back( ::getenv("QTDIR") );
qtdirs.push_back( "/usr/lib/qt3" );
qtdirs.push_back( "/usr/lib/qt" );
qtdirs.push_back( "/usr/share/qt3" );
for( QStringList::Iterator it
=qtdirs.
begin(); it
!=qtdirs.
end();
++it
) {
if( !qtdir.isEmpty() && isValidQtDir(qtdir) )
lst.push_back( qtdir );
}
return lst;
}
bool TrollProjectPart::isValidQtDir( const QString& path ) const
{
return QFile::exists( path + "/include/qt.h" );
}
QStringList TrollProjectPart::availableQtDirList() const
{
QStringList qtdirs, lst;
qtdirs.push_back( ::getenv("QTDIR") );
qtdirs.push_back( "/usr/lib/qt3" );
qtdirs.push_back( "/usr/lib/qt" );
qtdirs.push_back( "/usr/share/qt3" );
for( QStringList::Iterator it=qtdirs.begin(); it!=qtdirs.end(); ++it )
{
QString qtdir = *it;
if( !qtdir.isEmpty() && isValidQtDir(qtdir) )
lst.push_back( qtdir );
}
return lst;
}
To copy to clipboard, switch view to plain text mode
You could say -- "Ok, so it reads QTDIR env, so it should work". Well... yes, but not for Qt4. Look at how it check for valid QTDIRS -- it looks for $QTDIR/include/qt.h and with Qt4 no such file exists... A workaround would be to create one of course, but there are better ways to check for a Qt installation than scanning for $QTDIR/include/qt.h which may not be valid even for Qt3 (some distros keep Qt include files inside /usr/include/), so a patch is needed for different distros.
Anyway it doesn't look for Qt in a place, which was entered by the user in the configuration dialog.
Bookmarks