forked from qt-creator/qt-creator
QtSupport: Fix wrong build directory for examples
By partially reverting 92fbbaea9b
Task-number: QTCREATORBUG-13630
Change-Id: Ia04a224f2a12839d2cf27828009c945383a4c19c
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
committed by
Eike Ziller
parent
b36c399272
commit
d36c4d87db
@@ -651,7 +651,7 @@ QmakeBuildInfo *QmakeBuildConfigurationFactory::createBuildInfo(const Kit *k,
|
||||
|
||||
// check if this project is in the source directory:
|
||||
Utils::FileName projectFilePath = Utils::FileName::fromString(projectPath);
|
||||
if (version->isSubProject(projectFilePath)) {
|
||||
if (version->isInSourceDirectory(projectFilePath)) {
|
||||
// assemble build directory
|
||||
QString projectDirectory = projectFilePath.toFileInfo().absolutePath();
|
||||
QDir qtSourceDir = QDir(version->sourcePath().toString());
|
||||
|
||||
@@ -1478,6 +1478,17 @@ FileName BaseQtVersion::sourcePath(const QHash<QString, QString> &versionInfo)
|
||||
return FileName::fromUserInput(sourcePath);
|
||||
}
|
||||
|
||||
bool BaseQtVersion::isInSourceDirectory(const Utils::FileName &filePath)
|
||||
{
|
||||
const Utils::FileName &source = sourcePath();
|
||||
if (source.isEmpty())
|
||||
return false;
|
||||
QDir dir = QDir(source.toString());
|
||||
if (dir.dirName() == QLatin1String("qtbase"))
|
||||
dir.cdUp();
|
||||
return filePath.isChildOf(dir);
|
||||
}
|
||||
|
||||
bool BaseQtVersion::isSubProject(const Utils::FileName &filePath)
|
||||
{
|
||||
const Utils::FileName &source = sourcePath();
|
||||
|
||||
@@ -124,6 +124,7 @@ public:
|
||||
virtual Utils::Environment qmakeRunEnvironment() const;
|
||||
|
||||
virtual Utils::FileName sourcePath() const;
|
||||
bool isInSourceDirectory(const Utils::FileName &filePath);
|
||||
bool isSubProject(const Utils::FileName &filePath);
|
||||
|
||||
// used by UiCodeModelSupport
|
||||
|
||||
Reference in New Issue
Block a user