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: hjk <hjk121@nokiamail.com>
This commit is contained in:
Oleksii Serdiuk
2013-10-29 17:25:06 +01:00
committed by hjk
parent 9705ed8a1b
commit 62c00cfaed

View File

@@ -35,7 +35,9 @@
#include <projectexplorer/buildinfo.h>
#include <projectexplorer/kit.h>
#include <projectexplorer/target.h>
#include <projectexplorer/project.h>
#include <utils/environment.h>
#include <utils/qtcassert.h>
namespace CMakeProjectManager {
@@ -53,6 +55,9 @@ public:
kitId = bc->target()->kit()->id();
environment = bc->environment();
useNinja = bc->useNinja();
QTC_ASSERT(bc->target()->project(), return);
sourceDirectory = bc->target()->project()->projectDirectory();
}
Utils::Environment environment;