Xcode: Don't show QMAKE_INTERNAL_INCLUDED_FILES from Qt (prf/pri)

We build "Supporting Files" out of QMAKE_INTERNAL_INCLUDED_FILES, which
is really not supposed to be exposed to the user like that, but since
the variable will hold user-included pri files eg., the Xcode generator
piggy-backs on this variable to list the files.

To make the project view in Xcode a bit cleaner we explicitly exclude
any file living inside the Qt directory, meaning we won't show all the
pri and prf files from Qt's mkspecs directory anymore.

Change-Id: I828700aceac5fdf3ea2b27d9ba3885543c2ad137
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
This commit is contained in:
Tor Arne Vestbø 2014-07-24 13:23:48 +02:00
parent ca972866e2
commit bae184532d

View File

@ -463,10 +463,16 @@ ProjectBuilderSources::files(QMakeProject *project) const
{
QStringList ret = project->values(ProKey(key)).toQStringList();
if(key == "QMAKE_INTERNAL_INCLUDED_FILES") {
QString qtPrefix(QLibraryInfo::rawLocation(QLibraryInfo::PrefixPath, QLibraryInfo::EffectivePaths) + '/');
QString qtSrcPrefix(QLibraryInfo::rawLocation(QLibraryInfo::PrefixPath, QLibraryInfo::EffectiveSourcePaths) + '/');
QStringList newret;
for(int i = 0; i < ret.size(); ++i) {
if(!ret.at(i).endsWith(Option::prf_ext))
newret.append(ret.at(i));
// Don't show files "internal" to Qt in Xcode
if (ret.at(i).startsWith(qtPrefix) || ret.at(i).startsWith(qtSrcPrefix))
continue;
newret.append(ret.at(i));
}
ret = newret;
}
@ -567,6 +573,9 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
// doesn't have access to any of the information it needs to resolve relative paths.
project->values("QMAKE_INTERNAL_INCLUDED_FILES").prepend(fileFixify(project->projectFile(), qmake_getpwd(), input_dir));
// Since we can't fileFixify inside ProjectBuilderSources::files(), we resolve the absolute paths here
project->values("QMAKE_INTERNAL_INCLUDED_FILES") = ProStringList(fileFixify(project->values("QMAKE_INTERNAL_INCLUDED_FILES").toQStringList(), FileFixifyAbsolute));
//DUMP SOURCES
QMap<QString, ProStringList> groups;
QList<ProjectBuilderSources> sources;