CMakePM: Refactor CMakeLists|Cache.txt as constants

Change-Id: I7165fa1d219a0c59bc519a9af1cd194414c4311c
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Cristian Adam
2024-01-22 18:10:43 +01:00
parent b953735b22
commit 76a8966739
13 changed files with 39 additions and 25 deletions

View File

@@ -5,6 +5,7 @@
#include "cmakeprocess.h"
#include "cmakeprojectmanagertr.h"
#include "cmakeprojectconstants.h"
#include "cmakespecificsettings.h"
#include "fileapidataextractor.h"
#include "fileapiparser.h"
@@ -73,7 +74,7 @@ void FileApiReader::resetData()
m_cmakeFiles.clear();
if (!m_parameters.sourceDirectory.isEmpty()) {
CMakeFileInfo cmakeListsTxt;
cmakeListsTxt.path = m_parameters.sourceDirectory.pathAppended("CMakeLists.txt");
cmakeListsTxt.path = m_parameters.sourceDirectory.pathAppended(Constants::CMAKE_LISTS_TXT);
cmakeListsTxt.isCMakeListsDotTxt = true;
m_cmakeFiles.insert(cmakeListsTxt);
}
@@ -316,8 +317,8 @@ void FileApiReader::makeBackupConfiguration(bool store)
.arg(reply.toString(), replyPrev.toString())));
}
FilePath cmakeCacheTxt = m_parameters.buildDirectory.pathAppended("CMakeCache.txt");
FilePath cmakeCacheTxtPrev = m_parameters.buildDirectory.pathAppended("CMakeCache.txt.prev");
FilePath cmakeCacheTxt = m_parameters.buildDirectory.pathAppended(Constants::CMAKE_CACHE_TXT);
FilePath cmakeCacheTxtPrev = m_parameters.buildDirectory.pathAppended(Constants::CMAKE_CACHE_TXT_PREV);
if (!store)
std::swap(cmakeCacheTxt, cmakeCacheTxtPrev);