Commit 5563d6b3 authored by Brad King's avatar Brad King Committed by Kitware Robot
Browse files

Merge topic 'minor-cleanup'

fb73edf7 cmake: Drop unnecessary working mode checks
bd7dd6d4

 cmake: Declare VariableWatch member only when used
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !2326
parents b11e021b fb73edf7
......@@ -1262,10 +1262,7 @@ int cmake::ActualConfigure()
this->UpdateConversionPathTable();
this->CleanupCommandsAndMacros();
int res = 0;
if (this->GetWorkingMode() == NORMAL_MODE) {
res = this->DoPreConfigureChecks();
}
int res = this->DoPreConfigureChecks();
if (res < 0) {
return -2;
}
......@@ -1431,11 +1428,8 @@ int cmake::ActualConfigure()
"CMakeLists.txt ?");
}
// only save the cache if there were no fatal errors
if (this->GetWorkingMode() == NORMAL_MODE) {
this->State->SaveVerificationScript(this->GetHomeOutputDirectory());
this->SaveCache(this->GetHomeOutputDirectory());
}
this->State->SaveVerificationScript(this->GetHomeOutputDirectory());
this->SaveCache(this->GetHomeOutputDirectory());
if (cmSystemTools::GetErrorOccuredFlag()) {
return -1;
}
......@@ -1588,7 +1582,7 @@ int cmake::Run(const std::vector<std::string>& args, bool noconfigure)
}
int ret = this->Configure();
if (ret || this->GetWorkingMode() != NORMAL_MODE) {
if (ret) {
#if defined(CMAKE_HAVE_VS_GENERATORS)
if (!this->VSSolutionFile.empty() && this->GlobalGenerator) {
// CMake is running to regenerate a Visual Studio build tree
......@@ -1634,9 +1628,8 @@ int cmake::Generate()
// Save the cache again after a successful Generate so that any internal
// variables created during Generate are saved. (Specifically target GUIDs
// for the Visual Studio and Xcode generators.)
if (this->GetWorkingMode() == NORMAL_MODE) {
this->SaveCache(this->GetHomeOutputDirectory());
}
this->SaveCache(this->GetHomeOutputDirectory());
return 0;
}
......
......@@ -297,8 +297,10 @@ public:
///! this is called by generators to update the progress
void UpdateProgress(const char* msg, float prog);
#if defined(CMAKE_BUILD_WITH_CMAKE)
///! Get the variable watch object
cmVariableWatch* GetVariableWatch() { return this->VariableWatch; }
#endif
void GetGeneratorDocumentation(std::vector<cmDocumentationEntry>&);
......@@ -493,8 +495,6 @@ protected:
void GenerateGraphViz(const char* fileName) const;
cmVariableWatch* VariableWatch;
private:
ProgressCallbackType ProgressCallback;
void* ProgressCallbackClientData;
......@@ -525,6 +525,10 @@ private:
std::string GraphVizFile;
InstalledFilesMap InstalledFiles;
#if defined(CMAKE_BUILD_WITH_CMAKE)
cmVariableWatch* VariableWatch;
#endif
cmState* State;
cmStateSnapshot CurrentSnapshot;
cmMessenger* Messenger;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment