summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2005-12-21 13:46:41 (GMT)
committerBrad King <brad.king@kitware.com>2005-12-21 13:46:41 (GMT)
commit5b95c0a881735cba6d6fcc661c6696d67f6badcd (patch)
tree7f56aead1485d8be82c093f24ecc57b8a54595a7 /Source
parent932c5b74b8a1a7a10bc89c2084102790eed3f83e (diff)
downloadCMake-5b95c0a881735cba6d6fcc661c6696d67f6badcd.zip
CMake-5b95c0a881735cba6d6fcc661c6696d67f6badcd.tar.gz
CMake-5b95c0a881735cba6d6fcc661c6696d67f6badcd.tar.bz2
BUG: Libraries and executables that are built with version numbers and symlinks should be built by a rule using the real file name. The symlink file names should be rules that just depend on the main rule. This way if a version number changes a target will re-link with the new name and the symlinks will be updated.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx40
1 files changed, 35 insertions, 5 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 3f59c97..70627f3 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -1464,7 +1464,19 @@ cmLocalUnixMakefileGenerator3
// Write the build rule.
this->WriteMakeRule(ruleFileStream, 0,
- targetFullPath.c_str(), depends, commands);
+ targetFullPathReal.c_str(), depends, commands);
+
+ // The symlink name for the target should depend on the real target
+ // so if the target version changes it rebuilds and recreates the
+ // symlink.
+ if(targetFullPath != targetFullPathReal)
+ {
+ depends.clear();
+ commands.clear();
+ depends.push_back(targetFullPathReal.c_str());
+ this->WriteMakeRule(ruleFileStream, 0,
+ targetFullPath.c_str(), depends, commands);
+ }
// Write convenience targets.
std::string dir = m_Makefile->GetStartOutputDirectory();
@@ -1794,11 +1806,29 @@ cmLocalUnixMakefileGenerator3
linkFlags.c_str());
}
- // from here down is the same for exe or lib
-
// Write the build rule.
- this->WriteMakeRule(ruleFileStream, 0,
- targetFullPath.c_str(), depends, commands);
+ this->WriteMakeRule(ruleFileStream, 0,
+ targetFullPathReal.c_str(), depends, commands);
+
+ // The symlink names for the target should depend on the real target
+ // so if the target version changes it rebuilds and recreates the
+ // symlinks.
+ if(targetFullPathSO != targetFullPathReal)
+ {
+ depends.clear();
+ commands.clear();
+ depends.push_back(targetFullPathReal.c_str());
+ this->WriteMakeRule(ruleFileStream, 0,
+ targetFullPathSO.c_str(), depends, commands);
+ }
+ if(targetFullPath != targetFullPathSO)
+ {
+ depends.clear();
+ commands.clear();
+ depends.push_back(targetFullPathSO.c_str());
+ this->WriteMakeRule(ruleFileStream, 0,
+ targetFullPath.c_str(), depends, commands);
+ }
// Write convenience targets.
std::string dir = m_Makefile->GetStartOutputDirectory();