Commit 62c00cfa authored by Oleksii Serdiuk's avatar Oleksii Serdiuk Committed by hjk
Browse files

CMake: Fix for "The source directory does not contain CMakeLists.txt".

CMakeBuildInfo::sourceDirectory wasn't always populated, which sometimes
led to 'CMake Error: The source directory "<path>" does not appear to
contain CMakeLists.txt.' error when re-running CMake for shadow builds.

Change-Id: I4caece897155ee9e056d2da8185da43b94cbd99d
Reviewed-by: default avatarhjk <>
parent 9705ed8a
...@@ -35,7 +35,9 @@ ...@@ -35,7 +35,9 @@
#include <projectexplorer/buildinfo.h> #include <projectexplorer/buildinfo.h>
#include <projectexplorer/kit.h> #include <projectexplorer/kit.h>
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
#include <projectexplorer/project.h>
#include <utils/environment.h> #include <utils/environment.h>
#include <utils/qtcassert.h>
namespace CMakeProjectManager { namespace CMakeProjectManager {
...@@ -53,6 +55,9 @@ public: ...@@ -53,6 +55,9 @@ public:
kitId = bc->target()->kit()->id(); kitId = bc->target()->kit()->id();
environment = bc->environment(); environment = bc->environment();
useNinja = bc->useNinja(); useNinja = bc->useNinja();
QTC_ASSERT(bc->target()->project(), return);
sourceDirectory = bc->target()->project()->projectDirectory();
} }
Utils::Environment environment; Utils::Environment environment;
Supports Markdown
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