From bae184532dde3b8d46bd90d060377ab06dc62644 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 24 Jul 2014 13:23:48 +0200 Subject: Xcode: Don't show QMAKE_INTERNAL_INCLUDED_FILES from Qt (prf/pri) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ø --- qmake/generators/mac/pbuilder_pbx.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'qmake/generators/mac') diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index 0b8761180d..70ac77f5da 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -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 groups; QList sources; -- cgit v1.2.3