summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileExecutableTargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-02-16 20:39:19 (GMT)
committerBrad King <brad.king@kitware.com>2006-02-16 20:39:19 (GMT)
commit43df79d9fcc633d3232ba0b1c6f523bb0abf45a6 (patch)
tree90e203085d6291a02a578c84481429c7019768e4 /Source/cmMakefileExecutableTargetGenerator.cxx
parentad2cc1f3338fd5060082006f3a9b66434adbc042 (diff)
downloadCMake-43df79d9fcc633d3232ba0b1c6f523bb0abf45a6.zip
CMake-43df79d9fcc633d3232ba0b1c6f523bb0abf45a6.tar.gz
CMake-43df79d9fcc633d3232ba0b1c6f523bb0abf45a6.tar.bz2
BUG: Do not perform pre-build, pre-link, or post-install commands when relinking.
Diffstat (limited to 'Source/cmMakefileExecutableTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileExecutableTargetGenerator.cxx23
1 files changed, 15 insertions, 8 deletions
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index 87d6feb..c953b72 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -236,11 +236,15 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
this->Makefile->GetHomeOutputDirectory());
commands.insert(commands.end(), commands1.begin(), commands1.end());
commands1.clear();
- // Add the pre-build and pre-link rules.
- this->LocalGenerator->
- AppendCustomCommands(commands, this->Target->GetPreBuildCommands());
- this->LocalGenerator->
- AppendCustomCommands(commands, this->Target->GetPreLinkCommands());
+
+ // Add the pre-build and pre-link rules building but not when relinking.
+ if(!relink)
+ {
+ this->LocalGenerator
+ ->AppendCustomCommands(commands, this->Target->GetPreBuildCommands());
+ this->LocalGenerator
+ ->AppendCustomCommands(commands, this->Target->GetPreLinkCommands());
+ }
// Construct the main link rule.
std::string linkRuleVar = "CMAKE_";
@@ -265,9 +269,12 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
commands.push_back(symlink);
}
- // Add the post-build rules.
- this->LocalGenerator->AppendCustomCommands
- (commands, this->Target->GetPostBuildCommands());
+ // Add the post-build rules when building but not when relinking.
+ if(!relink)
+ {
+ this->LocalGenerator->
+ AppendCustomCommands(commands, this->Target->GetPostBuildCommands());
+ }
// Collect up flags to link in needed libraries.
cmOStringStream linklibs;