CMake: Fix projects with complex CMakeLists.txt layouts

This fixes soft assserts in e.g. Musescore.

Change-Id: I860c8c184161e53918fb901d66b89cffb0c09e23
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Tobias Hunger
2017-03-13 18:13:47 +01:00
parent b3238d5736
commit b8417e0f0c
4 changed files with 29 additions and 79 deletions

View File

@@ -218,7 +218,7 @@ QList<CMakeBuildTarget> CMakeBuildConfiguration::buildTargets() const
CMakeListsNode *
CMakeBuildConfiguration::generateProjectTree(const QList<const FileNode*> &allFiles) const
{
auto root = new CMakeListsNode(target()->project()->projectFilePath());
auto root = new CMakeListsNode(target()->project()->projectDirectory());
if (!m_buildDirManager || m_buildDirManager->isParsing())
return nullptr;