Commit 2f017c07 authored by Tobias Hunger (external)'s avatar Tobias Hunger (external) Committed by hjk
Browse files

AutoTools: Handle (abs_)?top_srcdir, and (abs_)?top_builddir



in include paths taken from the Autotools project.

These are widely used in include paths.

Change-Id: I78d5e1f6ce6cd7bfe92bb670b73e276cb558b9eb
Reviewed-by: default avatarhjk <hjk@theqtcompany.com>
parent 7901601e
......@@ -402,6 +402,24 @@ QList<Node *> AutotoolsProject::nodes(FolderNode *parent) const
return list;
}
static QStringList filterIncludes(const QString &absSrc, const QString &absBuild,
const QStringList &in)
{
QStringList result;
foreach (const QString i, in) {
QString out = i;
out.replace(QLatin1String("$(top_srcdir)"), absSrc);
out.replace(QLatin1String("$(abs_top_srcdir)"), absSrc);
out.replace(QLatin1String("$(top_builddir)"), absBuild);
out.replace(QLatin1String("$(abs_top_builddir)"), absBuild);
result << out;
}
return result;
}
void AutotoolsProject::updateCppCodeModel()
{
CppTools::CppModelManager *modelManager = CppTools::CppModelManager::instance();
......@@ -427,7 +445,12 @@ void AutotoolsProject::updateCppCodeModel()
ppBuilder.setCFlags(cflags);
ppBuilder.setCxxFlags(cxxflags);
ppBuilder.setIncludePaths(m_makefileParserThread->includePaths());
const QString absSrc = projectDirectory().toString();
const Target *target = activeTarget();
const QString absBuild = (target && target->activeBuildConfiguration())
? target->activeBuildConfiguration()->buildDirectory().toString() : QString();
ppBuilder.setIncludePaths(filterIncludes(absSrc, absBuild, m_makefileParserThread->includePaths()));
ppBuilder.setDefines(m_makefileParserThread->defines());
const QList<Core::Id> languages = ppBuilder.createProjectPartsForFiles(m_files);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment