summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalUnixMakefileGenerator3.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2007-08-03 20:31:08 (GMT)
committerBrad King <brad.king@kitware.com>2007-08-03 20:31:08 (GMT)
commitbffcff45302210b65728d4d6a4b831e1605150f0 (patch)
treeec02cebffba81d55eeaeabdd58544516dfb0423e /Source/cmGlobalUnixMakefileGenerator3.cxx
parentd7118006deaf15c6e1b796b33cd883dd9bfa14fb (diff)
downloadCMake-bffcff45302210b65728d4d6a4b831e1605150f0.zip
CMake-bffcff45302210b65728d4d6a4b831e1605150f0.tar.gz
CMake-bffcff45302210b65728d4d6a4b831e1605150f0.tar.bz2
ENH: Added warning when an install rule is created from an EXCLUDE_FROM_ALL target. Added a foo/preinstall version of targets that need relinking so that exclude-from-all targets can be manually relinked for installation.
Diffstat (limited to 'Source/cmGlobalUnixMakefileGenerator3.cxx')
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.cxx19
1 files changed, 18 insertions, 1 deletions
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 6b8d78d..319e847 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -539,7 +539,7 @@ cmGlobalUnixMakefileGenerator3
this->WriteDirectoryRule2(ruleFileStream, lg, "clean", false, false);
// Write directory-level rules for "preinstall".
- this->WriteDirectoryRule2(ruleFileStream, lg, "preinstall", false, true);
+ this->WriteDirectoryRule2(ruleFileStream, lg, "preinstall", true, true);
}
@@ -677,6 +677,23 @@ cmGlobalUnixMakefileGenerator3
(makefileName.c_str(), makeTargetName.c_str()));
lg->WriteMakeRule(ruleFileStream, "fast build rule for target.",
localName.c_str(), depends, commands, true);
+
+ // Add a local name for the rule to relink the target before
+ // installation.
+ if(t->second.NeedRelinkBeforeInstall())
+ {
+ makeTargetName = lg->GetRelativeTargetDirectory(t->second);
+ makeTargetName += "/preinstall";
+ localName = t->second.GetName();
+ localName += "/preinstall";
+ depends.clear();
+ commands.clear();
+ commands.push_back(lg->GetRecursiveMakeCall
+ (makefileName.c_str(), makeTargetName.c_str()));
+ lg->WriteMakeRule(ruleFileStream,
+ "Manual pre-install relink rule for target.",
+ localName.c_str(), depends, commands, true);
+ }
}
}
}