GUI: Fixed problem with absolute build dir

This commit is contained in:
Daniel Marjamäki 2017-10-08 15:01:03 +02:00
parent d3c9d06aa4
commit 09cdead6cb
1 changed files with 6 additions and 2 deletions

View File

@ -847,10 +847,14 @@ Settings MainWindow::getCppcheckSettings()
const QString &buildDir = mProjectFile->getBuildDir(); const QString &buildDir = mProjectFile->getBuildDir();
if (!buildDir.isEmpty()) { if (!buildDir.isEmpty()) {
if (QDir(buildDir).isAbsolute()) {
result.buildDir = buildDir.toStdString();
} else {
QString prjpath = QFileInfo(mProjectFile->getFilename()).absolutePath(); QString prjpath = QFileInfo(mProjectFile->getFilename()).absolutePath();
result.buildDir = (prjpath + '/' + buildDir).toStdString(); result.buildDir = (prjpath + '/' + buildDir).toStdString();
} }
} }
}
// Include directories (and files) are searched in listed order. // Include directories (and files) are searched in listed order.
// Global include directories must be added AFTER the per project include // Global include directories must be added AFTER the per project include