Commit c4ef72dd authored by Erik Verbruggen's avatar Erik Verbruggen Committed by Erik Verbruggen

CMake: work-around for CodeBlocks lack of framework support.

CodeBlocks is utterly ignorant of frameworks on Mac, and won't report
framework paths. The work-around is to check if the include path ends in
".framework", and if so, add the parent directory as framework path.

Task-number: QTCREATORBUG-11445
Change-Id: I794dd72d755d5593e36ebf59543d0a5e9fda3cce
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
parent 139a1a8d
......@@ -349,7 +349,22 @@ bool CMakeProject::parseCMakeLists()
// This explicitly adds -I. to the include paths
part->includePaths += projectDirectory();
part->includePaths += cbpparser.includeFiles();
foreach (const QString &includeFile, cbpparser.includeFiles()) {
// CodeBlocks is utterly ignorant of frameworks on Mac, and won't report framework
// paths. The work-around is to check if the include path ends in ".framework", and
// if so, add the parent directory as framework path.
if (includeFile.endsWith(QLatin1String(".framework"))) {
const int slashIdx = includeFile.lastIndexOf(QLatin1Char('/'));
if (slashIdx != -1) {
part->frameworkPaths += includeFile.left(slashIdx);
continue;
}
}
part->includePaths += includeFile;
}
part->projectDefines += cbpparser.defines();
CppTools::ProjectFileAdder adder(part->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