CMake: Fix cmake config can't be changed by user in tealeaf mode

Changes to the cmake configuration (via projects page) are not applied
in tealeaf mode.
The tealeafreader::parse method passes changed config parameters to
cmake only if the .cpb file does not exist. Since that file always
exists after project initialization the user can't change the cmake
config anymore.

Make tealeaf reader pass changed config parameters to cmake when
a reparse is forced. This restores the behavior from 4.2.2

Change-Id: I31ffad32d176e6290064b55758e4df96d2ffe6bc
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Claus Steuer
2017-07-16 09:00:55 +02:00
parent 13bcdf700d
commit bf10378992

View File

@@ -192,14 +192,13 @@ void TeaLeafReader::parse(bool force)
{ {
const QString cbpFile = findCbpFile(QDir(m_parameters.buildDirectory.toString())); const QString cbpFile = findCbpFile(QDir(m_parameters.buildDirectory.toString()));
const QFileInfo cbpFileFi = cbpFile.isEmpty() ? QFileInfo() : QFileInfo(cbpFile); const QFileInfo cbpFileFi = cbpFile.isEmpty() ? QFileInfo() : QFileInfo(cbpFile);
if (!cbpFileFi.exists()) { if (!cbpFileFi.exists() || force) {
// Initial create: // Initial create:
startCMake(toArguments(m_parameters.configuration, m_parameters.expander)); startCMake(toArguments(m_parameters.configuration, m_parameters.expander));
return; return;
} }
const bool mustUpdate = force const bool mustUpdate = m_cmakeFiles.isEmpty()
|| m_cmakeFiles.isEmpty()
|| anyOf(m_cmakeFiles, [&cbpFileFi](const FileName &f) { || anyOf(m_cmakeFiles, [&cbpFileFi](const FileName &f) {
return f.toFileInfo().lastModified() > cbpFileFi.lastModified(); return f.toFileInfo().lastModified() > cbpFileFi.lastModified();
}); });