summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-02-10 13:50:33 (GMT)
committerBrad King <brad.king@kitware.com>2009-02-10 13:50:33 (GMT)
commitc895d9f2e0dac609a8e3e126cc05a0400e9740a9 (patch)
treebeb15f3e759df34a6fbf6dd66d465f0c5be6112c
parent13f9bb646d5ce506efb8fc2d36b6f9ce2268fb2e (diff)
downloadCMake-c895d9f2e0dac609a8e3e126cc05a0400e9740a9.zip
CMake-c895d9f2e0dac609a8e3e126cc05a0400e9740a9.tar.gz
CMake-c895d9f2e0dac609a8e3e126cc05a0400e9740a9.tar.bz2
ENH: Give target in which custom commands build
This gives the cmTarget instance for which custom command rules are being generated to cmLocalUnixMakefileGenerator3::AppendCustomCommands. It will be useful in the future.
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx10
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.h2
-rw-r--r--Source/cmMakefileExecutableTargetGenerator.cxx9
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx9
-rw-r--r--Source/cmMakefileTargetGenerator.cxx2
-rw-r--r--Source/cmMakefileUtilityTargetGenerator.cxx4
6 files changed, 25 insertions, 11 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 3148d37..099ea98 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -954,12 +954,13 @@ void
cmLocalUnixMakefileGenerator3
::AppendCustomCommands(std::vector<std::string>& commands,
const std::vector<cmCustomCommand>& ccs,
+ cmTarget* target,
cmLocalGenerator::RelativeRoot relative)
{
for(std::vector<cmCustomCommand>::const_iterator i = ccs.begin();
i != ccs.end(); ++i)
{
- this->AppendCustomCommand(commands, *i, true, relative);
+ this->AppendCustomCommand(commands, *i, target, true, relative);
}
}
@@ -967,10 +968,13 @@ cmLocalUnixMakefileGenerator3
void
cmLocalUnixMakefileGenerator3
::AppendCustomCommand(std::vector<std::string>& commands,
- const cmCustomCommand& cc, bool echo_comment,
+ const cmCustomCommand& cc,
+ cmTarget* target,
+ bool echo_comment,
cmLocalGenerator::RelativeRoot relative,
std::ostream* content)
{
+ static_cast<void>(target); // Future use
// Optionally create a command to display the custom command's
// comment text. This is used for pre-build, pre-link, and
// post-build command comments. Custom build step commands have
@@ -1621,9 +1625,11 @@ void cmLocalUnixMakefileGenerator3
glIt->second.GetPostBuildCommands());
this->AppendCustomCommands(commands,
glIt->second.GetPreBuildCommands(),
+ &glIt->second,
cmLocalGenerator::START_OUTPUT);
this->AppendCustomCommands(commands,
glIt->second.GetPostBuildCommands(),
+ &glIt->second,
cmLocalGenerator::START_OUTPUT);
std::string targetName = glIt->second.GetName();
this->WriteMakeRule(ruleFileStream, targetString.c_str(),
diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h
index 0fdb593..3025078 100644
--- a/Source/cmLocalUnixMakefileGenerator3.h
+++ b/Source/cmLocalUnixMakefileGenerator3.h
@@ -326,10 +326,12 @@ protected:
const cmCustomCommand& cc);
void AppendCustomCommands(std::vector<std::string>& commands,
const std::vector<cmCustomCommand>& ccs,
+ cmTarget* target,
cmLocalGenerator::RelativeRoot relative =
cmLocalGenerator::HOME_OUTPUT);
void AppendCustomCommand(std::vector<std::string>& commands,
const cmCustomCommand& cc,
+ cmTarget* target,
bool echo_comment=false,
cmLocalGenerator::RelativeRoot relative =
cmLocalGenerator::HOME_OUTPUT,
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index 9477ebf..6a75902 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -299,9 +299,11 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
if(!relink)
{
this->LocalGenerator
- ->AppendCustomCommands(commands, this->Target->GetPreBuildCommands());
+ ->AppendCustomCommands(commands, this->Target->GetPreBuildCommands(),
+ this->Target);
this->LocalGenerator
- ->AppendCustomCommands(commands, this->Target->GetPreLinkCommands());
+ ->AppendCustomCommands(commands, this->Target->GetPreLinkCommands(),
+ this->Target);
}
// Determine whether a link script will be used.
@@ -436,7 +438,8 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
if(!relink)
{
this->LocalGenerator->
- AppendCustomCommands(commands, this->Target->GetPostBuildCommands());
+ AppendCustomCommands(commands, this->Target->GetPostBuildCommands(),
+ this->Target);
}
// Write the build rule.
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index a67b44a..7e5edc4 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -600,9 +600,11 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
if(!relink)
{
this->LocalGenerator
- ->AppendCustomCommands(commands, this->Target->GetPreBuildCommands());
+ ->AppendCustomCommands(commands, this->Target->GetPreBuildCommands(),
+ this->Target);
this->LocalGenerator
- ->AppendCustomCommands(commands, this->Target->GetPreLinkCommands());
+ ->AppendCustomCommands(commands, this->Target->GetPreLinkCommands(),
+ this->Target);
}
// Determine whether a link script will be used.
@@ -867,7 +869,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
if(!relink)
{
this->LocalGenerator->
- AppendCustomCommands(commands, this->Target->GetPostBuildCommands());
+ AppendCustomCommands(commands, this->Target->GetPostBuildCommands(),
+ this->Target);
}
// Write the build rule.
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 4e71b2c..6bc5bd2 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -1125,7 +1125,7 @@ void cmMakefileTargetGenerator
// Now append the actual user-specified commands.
cmOStringStream content;
- this->LocalGenerator->AppendCustomCommand(commands, cc, false,
+ this->LocalGenerator->AppendCustomCommand(commands, cc, this->Target, false,
cmLocalGenerator::HOME_OUTPUT,
&content);
diff --git a/Source/cmMakefileUtilityTargetGenerator.cxx b/Source/cmMakefileUtilityTargetGenerator.cxx
index da9ca0d..ab9d875 100644
--- a/Source/cmMakefileUtilityTargetGenerator.cxx
+++ b/Source/cmMakefileUtilityTargetGenerator.cxx
@@ -54,13 +54,13 @@ void cmMakefileUtilityTargetGenerator::WriteRuleFiles()
(depends, this->Target->GetPostBuildCommands());
this->LocalGenerator->AppendCustomCommands
- (commands, this->Target->GetPreBuildCommands());
+ (commands, this->Target->GetPreBuildCommands(), this->Target);
// Depend on all custom command outputs for sources
this->DriveCustomCommands(depends);
this->LocalGenerator->AppendCustomCommands
- (commands, this->Target->GetPostBuildCommands());
+ (commands, this->Target->GetPostBuildCommands(), this->Target);
// Add dependencies on targets that must be built first.
this->AppendTargetDepends(depends);