summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Source/CTest/cmCTestScriptHandler.cxx2
-rw-r--r--Source/cmGlobalGenerator.cxx2
-rw-r--r--Source/cmIncludeGuardCommand.cxx2
-rw-r--r--Source/cmMakefile.cxx22
-rw-r--r--Source/cmMakefile.h9
-rw-r--r--Source/cmVariableRequiresCommand.cxx2
6 files changed, 13 insertions, 26 deletions
diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx
index 85040ddc96..fc319b3298 100644
--- a/Source/CTest/cmCTestScriptHandler.cxx
+++ b/Source/CTest/cmCTestScriptHandler.cxx
@@ -360,7 +360,7 @@ int cmCTestScriptHandler::ReadInScript(const std::string& total_script_arg)
cmSystemTools::GetCTestCommand().c_str());
this->Makefile->AddDefinition("CMAKE_EXECUTABLE_NAME",
cmSystemTools::GetCMakeCommand().c_str());
- this->Makefile->AddDefinition("CTEST_RUN_CURRENT_SCRIPT", true);
+ this->Makefile->AddDefinitionBool("CTEST_RUN_CURRENT_SCRIPT", true);
this->SetRunCurrentScript(true);
this->UpdateElapsedTime();
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index ec4107b470..baa8559297 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -511,7 +511,7 @@ void cmGlobalGenerator::EnableLanguage(
bool fatalError = false;
- mf->AddDefinition("RUN_CONFIGURE", true);
+ mf->AddDefinitionBool("RUN_CONFIGURE", true);
std::string rootBin = this->CMakeInstance->GetHomeOutputDirectory();
rootBin += "/CMakeFiles";
diff --git a/Source/cmIncludeGuardCommand.cxx b/Source/cmIncludeGuardCommand.cxx
index 505b07cad7..3b126b0c4a 100644
--- a/Source/cmIncludeGuardCommand.cxx
+++ b/Source/cmIncludeGuardCommand.cxx
@@ -85,7 +85,7 @@ bool cmIncludeGuardCommand::InitialPass(std::vector<std::string> const& args,
status.SetReturnInvoked();
return true;
}
- mf->AddDefinition(includeGuardVar, true);
+ mf->AddDefinitionBool(includeGuardVar, true);
break;
case DIRECTORY:
if (CheckIncludeGuardIsSet(mf, includeGuardVar)) {
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 3177adcb76..1867809d35 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1803,6 +1803,11 @@ void cmMakefile::AddDefinition(const std::string& name, const char* value)
#endif
}
+void cmMakefile::AddDefinitionBool(const std::string& name, bool value)
+{
+ this->AddDefinition(name, value ? "ON" : "OFF");
+}
+
void cmMakefile::AddCacheDefinition(const std::string& name, const char* value,
const char* doc,
cmStateEnums::CacheEntryType type,
@@ -1848,23 +1853,6 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value,
this->StateSnapshot.RemoveDefinition(name);
}
-void cmMakefile::AddDefinition(const std::string& name, bool value)
-{
- if (this->VariableInitialized(name)) {
- this->LogUnused("changing definition", name);
- }
-
- this->StateSnapshot.SetDefinition(name, value ? "ON" : "OFF");
-
-#ifdef CMAKE_BUILD_WITH_CMAKE
- cmVariableWatch* vv = this->GetVariableWatch();
- if (vv) {
- vv->VariableAccessed(name, cmVariableWatch::VARIABLE_MODIFIED_ACCESS,
- value ? "ON" : "OFF", this);
- }
-#endif
-}
-
void cmMakefile::CheckForUnusedVariables() const
{
if (!this->WarnUnused) {
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 1eca18cd44..e685644667 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -264,17 +264,16 @@ public:
* can be used in CMake to refer to lists, directories, etc.
*/
void AddDefinition(const std::string& name, const char* value);
+ /**
+ * Add bool variable definition to the build.
+ */
+ void AddDefinitionBool(const std::string& name, bool value);
//! Add a definition to this makefile and the global cmake cache.
void AddCacheDefinition(const std::string& name, const char* value,
const char* doc, cmStateEnums::CacheEntryType type,
bool force = false);
/**
- * Add bool variable definition to the build.
- */
- void AddDefinition(const std::string& name, bool);
-
- /**
* Remove a variable definition from the build. This is not valid
* for cache entries, and will only affect the current makefile.
*/
diff --git a/Source/cmVariableRequiresCommand.cxx b/Source/cmVariableRequiresCommand.cxx
index c02157ad1e..9878ff1366 100644
--- a/Source/cmVariableRequiresCommand.cxx
+++ b/Source/cmVariableRequiresCommand.cxx
@@ -42,7 +42,7 @@ bool cmVariableRequiresCommand::InitialPass(
// if reqVar is set to true, but requirementsMet is false , then
// set reqVar to false.
if (!reqVar || (!requirementsMet && this->Makefile->IsOn(reqVar))) {
- this->Makefile->AddDefinition(resultVariable, requirementsMet);
+ this->Makefile->AddDefinitionBool(resultVariable, requirementsMet);
}
if (!requirementsMet) {