CMake: The first build of a cmake project always fails in tealeaf mode

The TeaLeafReader tries to parse the CMakeCache.txt before cmake is
executed for the first time.

The error is signaled to the CMakeBuildStep which reports the build as a
failure.

Make TeaLeafReader::takeParsedConfiguration return an empty
CMakeConfig object if the CMakeCache.txt file does not exist instead,
but do not report an error.

Task-number: QTCREATORBUG-18290
Change-Id: Ibfc43858938477ae7479029e8fe6786c77823014
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Claus Steuer
2017-06-19 17:21:38 +02:00
committed by Tobias Hunger
parent 0652297f5a
commit 523439d71b

View File

@@ -243,6 +243,10 @@ CMakeConfig TeaLeafReader::takeParsedConfiguration()
{
FileName cacheFile = m_parameters.buildDirectory;
cacheFile.appendPath(QLatin1String("CMakeCache.txt"));
if (!cacheFile.exists())
return { };
QString errorMessage;
CMakeConfig result = BuildDirManager::parseConfiguration(cacheFile, &errorMessage);