aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/genericprojectmanager
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2019-08-16 13:04:41 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2019-08-19 10:44:08 +0000
commit9f88fc881f671d20170dc7463194f12530dfceda (patch)
treeafdef55e868fbb80883abae896ab1cf92323b222 /src/plugins/genericprojectmanager
parent2689f837f3ac4a5d8ed05039f6d1b3620ada783d (diff)
GenericProjectManager: Support framework paths
Rather than adding yet another meta file, we use the .includes file with a special line prefix. Fixes: QTCREATORBUG-20099 Change-Id: I494e0143b8e0f1f8828a56d7487b2201f1680337 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/plugins/genericprojectmanager')
-rw-r--r--src/plugins/genericprojectmanager/genericproject.cpp21
-rw-r--r--src/plugins/genericprojectmanager/genericproject.h3
2 files changed, 20 insertions, 4 deletions
diff --git a/src/plugins/genericprojectmanager/genericproject.cpp b/src/plugins/genericprojectmanager/genericproject.cpp
index 9a1d7b130d1..3ce786124d1 100644
--- a/src/plugins/genericprojectmanager/genericproject.cpp
+++ b/src/plugins/genericprojectmanager/genericproject.cpp
@@ -291,7 +291,8 @@ bool GenericProject::addFiles(const QStringList &filePaths)
for (const QString &filePath : filePaths)
insertSorted(&newList, baseDir.relativeFilePath(filePath));
- const QSet<QString> includes = Utils::toSet(m_projectIncludePaths);
+ const auto includes = transform<QSet<QString>>(m_projectIncludePaths,
+ [](const HeaderPath &hp) { return hp.path; });
QSet<QString> toAdd;
for (const QString &filePath : filePaths) {
@@ -375,7 +376,21 @@ void GenericProject::parseProject(RefreshOptions options)
if (options & Configuration) {
m_rawProjectIncludePaths = readLines(m_includesFileName);
- m_projectIncludePaths = processEntries(m_rawProjectIncludePaths);
+ QStringList normalPaths;
+ QStringList frameworkPaths;
+ for (const QString &rawPath : m_rawProjectIncludePaths) {
+ if (rawPath.startsWith("-F"))
+ frameworkPaths << rawPath.mid(2);
+ else
+ normalPaths << rawPath;
+ }
+ const auto stringsToHeaderPaths = [this](const QStringList &paths, HeaderPathType type) {
+ return transform<HeaderPaths>(processEntries(paths),
+ [type](const QString &p) { return HeaderPath(p, type);
+ });
+ };
+ m_projectIncludePaths = stringsToHeaderPaths(normalPaths, HeaderPathType::User);
+ m_projectIncludePaths << stringsToHeaderPaths(frameworkPaths, HeaderPathType::Framework);
m_cxxflags = readFlags(m_cxxflagsFileName);
m_cflags = readFlags(m_cflagsFileName);
@@ -499,7 +514,7 @@ void GenericProject::refreshCppCodeModel()
rpp.setDisplayName(displayName());
rpp.setProjectFileLocation(projectFilePath().toString());
rpp.setQtVersion(kitInfo.projectPartQtVersion);
- rpp.setIncludePaths(m_projectIncludePaths);
+ rpp.setHeaderPaths(m_projectIncludePaths);
rpp.setConfigFileName(m_configFileName);
rpp.setFlagsForCxx({nullptr, m_cxxflags});
rpp.setFlagsForC({nullptr, m_cflags});
diff --git a/src/plugins/genericprojectmanager/genericproject.h b/src/plugins/genericprojectmanager/genericproject.h
index 2072558f551..be1de1606e4 100644
--- a/src/plugins/genericprojectmanager/genericproject.h
+++ b/src/plugins/genericprojectmanager/genericproject.h
@@ -25,6 +25,7 @@
#pragma once
+#include <projectexplorer/headerpath.h>
#include <projectexplorer/project.h>
#include <utils/fileutils.h>
@@ -82,7 +83,7 @@ private:
QStringList m_files;
QHash<QString, QString> m_rawListEntries;
QStringList m_rawProjectIncludePaths;
- QStringList m_projectIncludePaths;
+ ProjectExplorer::HeaderPaths m_projectIncludePaths;
QStringList m_cxxflags;
QStringList m_cflags;