CMakePM: Do backup/restore configuration for all cases

When "Auto create build directories" is not checked, then the first
configuration is done in /tmp, which is covered by workDirectory.

Change-Id: Iad65b4776433ce296bd2561195fcf1bb6f8ace1d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Cristian Adam
2021-06-03 12:08:16 +02:00
parent 1b3a4e1fc6
commit 80d18c1e57

View File

@@ -312,8 +312,8 @@ void FileApiReader::endState(const QFileInfo &replyFi)
void FileApiReader::makeBackupConfiguration(bool store) void FileApiReader::makeBackupConfiguration(bool store)
{ {
FilePath reply = m_parameters.buildDirectory.pathAppended(".cmake/api/v1/reply"); FilePath reply = m_parameters.workDirectory.pathAppended(".cmake/api/v1/reply");
FilePath replyPrev = m_parameters.buildDirectory.pathAppended(".cmake/api/v1/reply.prev"); FilePath replyPrev = m_parameters.workDirectory.pathAppended(".cmake/api/v1/reply.prev");
if (!store) if (!store)
std::swap(reply, replyPrev); std::swap(reply, replyPrev);
@@ -327,8 +327,8 @@ void FileApiReader::makeBackupConfiguration(bool store)
} }
FilePath cmakeCacheTxt = m_parameters.buildDirectory.pathAppended("CMakeCache.txt"); FilePath cmakeCacheTxt = m_parameters.workDirectory.pathAppended("CMakeCache.txt");
FilePath cmakeCacheTxtPrev = m_parameters.buildDirectory.pathAppended("CMakeCache.txt.prev"); FilePath cmakeCacheTxtPrev = m_parameters.workDirectory.pathAppended("CMakeCache.txt.prev");
if (!store) if (!store)
std::swap(cmakeCacheTxt, cmakeCacheTxtPrev); std::swap(cmakeCacheTxt, cmakeCacheTxtPrev);