diff --git a/Source/cmAddCustomTargetCommand.cxx b/Source/cmAddCustomTargetCommand.cxx index d9879cf98..9d73cd092 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 a03a70a66..508a83a0c 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 67cd0c1ac..4b895e2d5 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 no_depends; std::map >::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 88579e796..70b2ad538 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 no_depends; const char* no_working_dir = 0; std::map >::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 923e468c5..03595a3af 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 no_depends; std::map >::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 760eb7be8..1b3236b29 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 no_depends; std::map >::iterator it; @@ -90,10 +89,10 @@ void cmGlobalVisualStudio8Generator::Generate() static_cast(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 728e37eee..dbdf8d1b0 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 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 b5038faad..143773a85 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 38be4ca6c..d99182c85 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& 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& 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 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 e4eae42a5..49071c4e9 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& 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& depends, const cmCustomCommandLines& commandLines, diff --git a/Source/cmVTKWrapJavaCommand.cxx b/Source/cmVTKWrapJavaCommand.cxx index 690ba0a32..fd1c16f47 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, ""); }