diff options
author | Brad King <brad.king@kitware.com> | 2006-09-28 13:55:26 -0400 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2006-09-28 13:55:26 -0400 |
commit | 7d2de52c1a617a8a559e5c749ce5e6abd3739f01 (patch) | |
tree | 3ae6b364d9f04d7cdcacd6ddc8ddd8f9e9bc0063 | |
parent | 506dca3990e56281bd0eecd6c26afe6d36caab6e (diff) | |
download | cmake-7d2de52c1a617a8a559e5c749ce5e6abd3739f01.tar.gz |
ENH: Cleaned up signature of cmMakefile::AddUtilityCommand. It is not valid to have an output from a utility rule and no calls to the method asked for an output anyway. The argument has been removed.
-rw-r--r-- | Source/cmAddCustomTargetCommand.cxx | 3 | ||||
-rw-r--r-- | Source/cmCPluginAPI.cxx | 16 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 3 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio6Generator.cxx | 3 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio7Generator.cxx | 3 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio8Generator.cxx | 7 | ||||
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 5 | ||||
-rw-r--r-- | Source/cmIncludeExternalMSProjectCommand.cxx | 3 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 8 | ||||
-rw-r--r-- | Source/cmMakefile.h | 2 | ||||
-rw-r--r-- | Source/cmVTKWrapJavaCommand.cxx | 7 |
11 files changed, 17 insertions, 43 deletions
diff --git a/Source/cmAddCustomTargetCommand.cxx b/Source/cmAddCustomTargetCommand.cxx index d9879cf988..9d73cd0923 100644 --- a/Source/cmAddCustomTargetCommand.cxx +++ b/Source/cmAddCustomTargetCommand.cxx @@ -149,8 +149,7 @@ bool cmAddCustomTargetCommand::InitialPass( // Add the utility target to the makefile. bool escapeOldStyle = !verbatim; - const char* no_output = 0; - this->Makefile->AddUtilityCommand(args[0].c_str(), all, no_output, + this->Makefile->AddUtilityCommand(args[0].c_str(), all, working_directory.c_str(), depends, commandLines, escapeOldStyle); diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx index a03a70a663..508a83a0c7 100644 --- a/Source/cmCPluginAPI.cxx +++ b/Source/cmCPluginAPI.cxx @@ -206,8 +206,8 @@ void CCONV cmAddUtilityCommand(void *arg, const char* utilityName, int all, int numDepends, const char **depends, - int numOutputs, - const char **outputs) + int, + const char **) { // Get the makefile instance. Perform an extra variable expansion // now because the API caller expects it. @@ -234,19 +234,9 @@ void CCONV cmAddUtilityCommand(void *arg, const char* utilityName, depends2.push_back(mf->ExpandVariablesInString(expand)); } - // Only one output is allowed. - const char* output = 0; - std::string outputStr; - if(numOutputs > 0) - { - expand = outputs[0]; - outputStr = mf->ExpandVariablesInString(expand); - output = outputStr.c_str(); - } - // Pass the call to the makefile instance. mf->AddUtilityCommand(utilityName, (all ? true : false), - output, 0, depends2, commandLines); + 0, depends2, commandLines); } void CCONV cmAddCustomCommand(void *arg, const char* source, const char* command, diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 67cd0c1ac8..4b895e2d51 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1300,7 +1300,6 @@ void cmGlobalGenerator::SetupTests() // If the file doesn't exist, then ENABLE_TESTING hasn't been run if (total_tests > 0) { - const char* no_output = 0; const char* no_working_dir = 0; std::vector<std::string> no_depends; std::map<cmStdString, std::vector<cmLocalGenerator*> >::iterator it; @@ -1313,7 +1312,7 @@ void cmGlobalGenerator::SetupTests() cmMakefile* mf = gen[0]->GetMakefile(); if(const char* outDir = mf->GetDefinition("CMAKE_CFG_INTDIR")) { - mf->AddUtilityCommand("RUN_TESTS", false, no_output, no_depends, + mf->AddUtilityCommand("RUN_TESTS", false, no_depends, no_working_dir, ctest.c_str(), "-C", outDir); } diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx index 88579e796b..70b2ad5388 100644 --- a/Source/cmGlobalVisualStudio6Generator.cxx +++ b/Source/cmGlobalVisualStudio6Generator.cxx @@ -162,7 +162,6 @@ void cmGlobalVisualStudio6Generator::Generate() { // add a special target that depends on ALL projects for easy build // of one configuration only. - const char* no_output = 0; std::vector<std::string> no_depends; const char* no_working_dir = 0; std::map<cmStdString, std::vector<cmLocalGenerator*> >::iterator it; @@ -173,7 +172,7 @@ void cmGlobalVisualStudio6Generator::Generate() if(gen.size()) { gen[0]->GetMakefile()->AddUtilityCommand("ALL_BUILD", false, - no_output, no_depends, + no_depends, no_working_dir, "echo", "Build all projects"); } diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 923e468c57..03595a3af3 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -216,7 +216,6 @@ void cmGlobalVisualStudio7Generator::Generate() { // add a special target that depends on ALL projects for easy build // of one configuration only. - const char* no_output = 0; const char* no_working_dir = 0; std::vector<std::string> no_depends; std::map<cmStdString, std::vector<cmLocalGenerator*> >::iterator it; @@ -227,7 +226,7 @@ void cmGlobalVisualStudio7Generator::Generate() if(gen.size()) { gen[0]->GetMakefile()-> - AddUtilityCommand("ALL_BUILD", false, no_output, no_depends, + AddUtilityCommand("ALL_BUILD", false, no_depends, no_working_dir, "echo", "Build all projects"); std::string cmake_command = diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index 760eb7be85..1b3236b296 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -75,7 +75,6 @@ void cmGlobalVisualStudio8Generator::Generate() { // Add a special target on which all other targets depend that // checks the build system and optionally re-runs CMake. - const char* no_output = 0; const char* no_working_directory = 0; std::vector<std::string> no_depends; std::map<cmStdString, std::vector<cmLocalGenerator*> >::iterator it; @@ -90,10 +89,10 @@ void cmGlobalVisualStudio8Generator::Generate() static_cast<cmLocalVisualStudio7Generator*>(generators[0]); cmMakefile* mf = lg->GetMakefile(); std::string cmake_command = mf->GetRequiredDefinition("CMAKE_COMMAND"); + cmCustomCommandLines noCommandLines; mf->AddUtilityCommand(CMAKE_CHECK_BUILD_SYSTEM_TARGET, true, - no_output, no_depends, - no_working_directory, - "echo", "Checking build system"); + no_working_directory, no_depends, + noCommandLines); cmTarget* tgt = mf->FindTarget(CMAKE_CHECK_BUILD_SYSTEM_TARGET); if(!tgt) { diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 728e37eeea..dbdf8d1b09 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -281,10 +281,9 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root, { cmMakefile* mf = root->GetMakefile(); // Add ALL_BUILD - const char* no_output = 0; const char* no_working_directory = 0; std::vector<std::string> no_depends; - mf->AddUtilityCommand("ALL_BUILD", false, no_output, no_depends, + mf->AddUtilityCommand("ALL_BUILD", false, no_depends, no_working_directory, "echo", "Build all projects"); cmTarget* allbuild = mf->FindTarget("ALL_BUILD"); @@ -307,7 +306,7 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root, } cmCustomCommandLines commandLines; commandLines.push_back(makecommand); - mf->AddUtilityCommand("XCODE_DEPEND_HELPER", false, no_output, + mf->AddUtilityCommand("XCODE_DEPEND_HELPER", false, no_working_directory, no_depends, commandLines); diff --git a/Source/cmIncludeExternalMSProjectCommand.cxx b/Source/cmIncludeExternalMSProjectCommand.cxx index b5038faad6..143773a850 100644 --- a/Source/cmIncludeExternalMSProjectCommand.cxx +++ b/Source/cmIncludeExternalMSProjectCommand.cxx @@ -46,10 +46,9 @@ bool cmIncludeExternalMSProjectCommand utility_name += args[0]; std::string path = args[1]; cmSystemTools::ConvertToUnixSlashes(path); - const char* no_output = 0; const char* no_working_directory = 0; this->Makefile->AddUtilityCommand(utility_name.c_str(), true, - no_output, depends, + depends, no_working_directory, args[0].c_str(), path.c_str()); diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 38be4ca6c4..d99182c857 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -783,7 +783,6 @@ cmMakefile::AddCustomCommandOldStyle(const char* target, //---------------------------------------------------------------------------- void cmMakefile::AddUtilityCommand(const char* utilityName, bool all, - const char* output, const std::vector<std::string>& depends, const char* workingDirectory, const char* command, @@ -815,13 +814,12 @@ void cmMakefile::AddUtilityCommand(const char* utilityName, bool all, commandLines.push_back(commandLine); // Call the real signature of this method. - this->AddUtilityCommand(utilityName, all, output, workingDirectory, + this->AddUtilityCommand(utilityName, all, workingDirectory, depends, commandLines); } //---------------------------------------------------------------------------- void cmMakefile::AddUtilityCommand(const char* utilityName, bool all, - const char* output, const char* workingDirectory, const std::vector<std::string>& depends, const cmCustomCommandLines& commandLines, @@ -834,10 +832,6 @@ void cmMakefile::AddUtilityCommand(const char* utilityName, bool all, target.SetMakefile(this); // Store the custom command in the target. std::vector<std::string> outputs; - if(output) - { - outputs.push_back(output); - } cmCustomCommand cc(outputs, depends, commandLines, 0, workingDirectory); cc.SetEscapeOldStyle(escapeOldStyle); target.GetPostBuildCommands().push_back(cc); diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index e4eae42a54..49071c4e99 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -183,7 +183,6 @@ public: * is run every time the target is built. */ void AddUtilityCommand(const char* utilityName, bool all, - const char* output, const std::vector<std::string>& depends, const char* workingDirectory, const char* command, @@ -192,7 +191,6 @@ public: const char* arg3=0, const char* arg4=0); void AddUtilityCommand(const char* utilityName, bool all, - const char* output, const char* workingDirectory, const std::vector<std::string>& depends, const cmCustomCommandLines& commandLines, diff --git a/Source/cmVTKWrapJavaCommand.cxx b/Source/cmVTKWrapJavaCommand.cxx index 690ba0a324..fd1c16f477 100644 --- a/Source/cmVTKWrapJavaCommand.cxx +++ b/Source/cmVTKWrapJavaCommand.cxx @@ -190,9 +190,8 @@ void cmVTKWrapJavaCommand::FinalPass() alldepends.push_back(res2); } - const char* no_output = 0; const char* no_working_directory = 0; - this->Makefile->AddUtilityCommand((this->LibraryName+"JavaClasses").c_str(), - true, no_output, - alldepends, no_working_directory, ""); + this->Makefile->AddUtilityCommand( + (this->LibraryName+"JavaClasses").c_str(), + true, alldepends, no_working_directory, ""); } |