summaryrefslogtreecommitdiff
path: root/src/plugins/cmakeprojectmanager/builddirparameters.cpp
diff options
context:
space:
mode:
authorCristian Adam <cristian.adam@qt.io>2021-02-04 16:22:40 +0100
committerCristian Adam <cristian.adam@qt.io>2021-02-18 13:21:11 +0000
commitfc411cd0d1806435a9c89e8a10cdfed012663fd9 (patch)
treec3846def813a90fd67444a3f14cc4c9e321c3e02 /src/plugins/cmakeprojectmanager/builddirparameters.cpp
parent2fb9d080829cf766bf7fb0cf5b69b85fc35fc2bd (diff)
downloadqt-creator-fc411cd0d1806435a9c89e8a10cdfed012663fd9.tar.gz
CMakeProjectManager: Make backup of CMake configuration before starting CMake
CMake's fileapi functionality will save the project structure in json files in the .cmake/api/v1/reply directory. When issuing a cmake command with -D variables CMake will update its CMakeCache.txt file even if cmake will fail. This commit will rename .cmake/api/v1/reply as .cmake/api/v1/reply.prev and make a copy of CMakeCache.txt before starting CMake, and if something fails, replace the existing files with the previous values. Also make sure the changed values are not dissappearing when the old .cmake/api/v1/reply gets parsed. Fixes: QTCREATORBUG-24593 Change-Id: I82141786fea7068699e0f761a8978ba1f3203e47 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/plugins/cmakeprojectmanager/builddirparameters.cpp')
-rw-r--r--src/plugins/cmakeprojectmanager/builddirparameters.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/cmakeprojectmanager/builddirparameters.cpp b/src/plugins/cmakeprojectmanager/builddirparameters.cpp
index 023de6b071..0c06c329f5 100644
--- a/src/plugins/cmakeprojectmanager/builddirparameters.cpp
+++ b/src/plugins/cmakeprojectmanager/builddirparameters.cpp
@@ -59,7 +59,7 @@ BuildDirParameters::BuildDirParameters(CMakeBuildConfiguration *bc)
});
initialCMakeArguments = Utils::filtered(expandedArguments,
[](const QString &s) { return !s.isEmpty(); });
- extraCMakeArguments = Utils::transform(bc->extraCMakeArguments(),
+ extraCMakeArguments = Utils::transform(bc->configurationChangesArguments(),
[expander](const QString &s) {
return expander->expand(s);
});