From cf8fb5c6f8d9f16486d498849d86df5a025373c9 Mon Sep 17 00:00:00 2001
From: Brad King <brad.king@kitware.com>
Date: Fri, 25 Feb 2005 09:19:04 -0500
Subject: ENH: Adding inclusion of pre-build and pre-link commands when
 building executables and libraries.

---
 Source/cmLocalUnixMakefileGenerator2.cxx | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/Source/cmLocalUnixMakefileGenerator2.cxx b/Source/cmLocalUnixMakefileGenerator2.cxx
index 85256a6..2bf1b33 100644
--- a/Source/cmLocalUnixMakefileGenerator2.cxx
+++ b/Source/cmLocalUnixMakefileGenerator2.cxx
@@ -779,8 +779,6 @@ cmLocalUnixMakefileGenerator2
   ruleFileStream
     << "# Utility rule file for " << target.GetName() << ".\n\n";
 
-  // TODO: Pre-build and pre-link rules.
-
   // Collect the commands and dependencies.
   std::vector<std::string> commands;
   std::vector<std::string> depends;
@@ -1645,7 +1643,9 @@ cmLocalUnixMakefileGenerator2
   // Add target-specific linker flags.
   this->AppendFlags(linkFlags, target.GetProperty("LINK_FLAGS"));
 
-  // TODO: Pre-build and pre-link rules.
+  // Add the pre-build and pre-link rules.
+  this->AppendCustomCommands(commands, target.GetPreBuildCommands());
+  this->AppendCustomCommands(commands, target.GetPreLinkCommands());
 
   // Construct the main link rule.
   std::string linkRuleVar = "CMAKE_";
@@ -1891,7 +1891,9 @@ cmLocalUnixMakefileGenerator2
     }
   this->AppendCleanCommand(commands, cleanFiles);
 
-  // TODO: Pre-build and pre-link rules.
+  // Add the pre-build and pre-link rules.
+  this->AppendCustomCommands(commands, target.GetPreBuildCommands());
+  this->AppendCustomCommands(commands, target.GetPreLinkCommands());
 
   // Construct the main link rule.
   std::string linkRule = m_Makefile->GetRequiredDefinition(linkRuleVar);
-- 
cgit v0.12