From 66ea097554b4abe398d5046a8ad45e935053d7fc Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Thu, 23 Feb 2006 17:30:12 -0500 Subject: ENH: Properly handle target dependencies --- Source/cmGlobalGenerator.cxx | 18 +++++++++++++----- Source/cmLocalUnixMakefileGenerator3.cxx | 8 +++++--- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index ade6421..52f3480 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1237,8 +1237,8 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) singleLine.push_back(this->GetCMakeInstance()->GetCTestCommand()); singleLine.push_back("--force-new-ctest-process"); cpackCommandLines.push_back(singleLine); - (*targets)[this->GetPackageTargetName()] - = this->CreateGlobalTarget(this->GetPackageTargetName(), + (*targets)[this->GetTestTargetName()] + = this->CreateGlobalTarget(this->GetTestTargetName(), "Running tests...", &cpackCommandLines, depends); //Edit Cache @@ -1306,6 +1306,7 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) singleLine.push_back("-P"); singleLine.push_back("cmake_install.cmake"); cpackCommandLines.push_back(singleLine); + /* const char* noall = mf->GetDefinition("CMAKE_SKIP_INSTALL_ALL_DEPENDENCY"); bool dependsOnAll = false; @@ -1313,10 +1314,11 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) { dependsOnAll = true; } + */ (*targets)[this->GetInstallTargetName()] = this->CreateGlobalTarget( this->GetInstallTargetName(), "Install the project...", - &cpackCommandLines, depends, dependsOnAll); + &cpackCommandLines, depends); } cmTarget cmGlobalGenerator::CreateGlobalTarget( @@ -1330,13 +1332,19 @@ cmTarget cmGlobalGenerator::CreateGlobalTarget( target.SetType(cmTarget::GLOBAL_TARGET, name); target.SetInAll(false); + std::vector fileDepends; // Store the custom command in the target. - cmCustomCommand cc(0, depends, *commandLines, 0, 0); + cmCustomCommand cc(0, fileDepends, *commandLines, 0, 0); target.GetPostBuildCommands().push_back(cc); target.SetProperty("EchoString", message); if ( depends_on_all ) { - target.SetProperty("DependsOnAll", "ON"); + target.AddUtility("all"); + } + std::vector::iterator dit; + for ( dit = depends.begin(); dit != depends.end(); ++ dit ) + { + target.AddUtility(dit->c_str()); } return target; } diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 13cd316..6ac963a 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -1266,10 +1266,12 @@ void cmLocalUnixMakefileGenerator3 { text = "Running external command ..."; } - const char* dependsOnAll = glIt->second.GetProperty("DependsOnAll"); - if ( dependsOnAll || cmSystemTools::IsOn(dependsOnAll) ) + std::set::iterator dit; + for ( dit = glIt->second.GetUtilities().begin(); + dit != glIt->second.GetUtilities().end(); + ++ dit ) { - depends.push_back("all"); + depends.push_back(dit->c_str()); } this->AppendEcho(commands, text); -- cgit v0.12