diff options
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r-- | Source/cmake.cxx | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index bab0aaf..221a2f3 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -2310,11 +2310,6 @@ int cmake::Run(const std::vector<std::string>& args, bool noconfigure) std::string oldstartoutputdir = this->GetStartOutputDirectory(); this->SetStartDirectory(this->GetHomeDirectory()); this->SetStartOutputDirectory(this->GetHomeOutputDirectory()); - const bool warncli = this->WarnUnusedCli; - if (!this->ScriptMode) - { - this->WarnUnusedCli = false; - } int ret = this->Configure(); if (ret || this->ScriptMode) { @@ -2336,7 +2331,6 @@ int cmake::Run(const std::vector<std::string>& args, bool noconfigure) #endif return ret; } - this->WarnUnusedCli = warncli; ret = this->Generate(); std::string message = "Build files have been written to: "; message += this->GetHomeOutputDirectory(); @@ -2358,6 +2352,10 @@ int cmake::Generate() return -1; } this->GlobalGenerator->Generate(); + if(this->WarnUnusedCli) + { + this->RunCheckForUnusedVariables(); + } if(cmSystemTools::GetErrorOccuredFlag()) { return -1; @@ -4320,23 +4318,25 @@ void cmake::UnwatchUnusedCli(const char* var) #endif } -void cmake::RunCheckForUnusedVariables(const std::string& reason) const +void cmake::RunCheckForUnusedVariables() { #ifdef CMAKE_BUILD_WITH_CMAKE - if(this->WarnUnusedCli) + bool haveUnused = false; + cmOStringStream msg; + msg << "Manually-specified variables were not used by the project:"; + for(std::map<cmStdString, bool>::const_iterator + it = this->UsedCliVariables.begin(); + it != this->UsedCliVariables.end(); ++it) + { + if(!it->second) { - std::map<std::string, bool>::const_iterator it; - for(it = this->UsedCliVariables.begin(); - it != this->UsedCliVariables.end(); ++it) - { - if(!it->second) - { - std::string message = "CMake Warning: The variable, '" + it->first + - "', specified manually, was not used during the " + reason + - "."; - cmSystemTools::Message(message.c_str()); - } - } + haveUnused = true; + msg << "\n " << it->first; } + } + if(haveUnused) + { + this->IssueMessage(cmake::WARNING, msg.str(), cmListFileBacktrace()); + } #endif } |