summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2004-06-28 18:40:17 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2004-06-28 18:40:17 (GMT)
commitf9b43b9212b1ae2ba4dd9c4f609f8d5093421398 (patch)
tree3d0d7dc4ceb4f927efa927a568adc2594a58d355 /Source/cmLocalGenerator.cxx
parentd392ccaee563a7f757eae72d9b32ea258e846a7c (diff)
downloadCMake-f9b43b9212b1ae2ba4dd9c4f609f8d5093421398.zip
CMake-f9b43b9212b1ae2ba4dd9c4f609f8d5093421398.tar.gz
CMake-f9b43b9212b1ae2ba4dd9c4f609f8d5093421398.tar.bz2
BUG: Implement installing of shared library versioning and add test for the whole thing
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx31
1 files changed, 28 insertions, 3 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 61cb39d..f337ff1 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -189,7 +189,27 @@ void cmLocalGenerator::GenerateInstallRules()
else
{
files = fname.c_str();
- this->AddInstallRule(fout, dest, type, files);
+ std::string properties;
+ const char* lib_version = l->second.GetProperty("VERSION");
+ const char* lib_soversion = l->second.GetProperty("SOVERSION");
+ if(!m_Makefile->GetDefinition("CMAKE_SHARED_LIBRARY_SONAME_C_FLAG"))
+ {
+ // Versioning is supported only for shared libraries and modules,
+ // and then only when the platform supports an soname flag.
+ lib_version = 0;
+ lib_soversion = 0;
+ }
+ if ( lib_version )
+ {
+ properties += " VERSION ";
+ properties += lib_version;
+ }
+ if ( lib_soversion )
+ {
+ properties += " SOVERSION ";
+ properties += lib_soversion;
+ }
+ this->AddInstallRule(fout, dest, type, files, false, properties.c_str());
}
}
break;
@@ -283,7 +303,7 @@ void cmLocalGenerator::GenerateInstallRules()
}
void cmLocalGenerator::AddInstallRule(std::ostream& fout, const char* dest,
- int type, const char* files, bool optional)
+ int type, const char* files, bool optional /* = false */, const char* properties /* = 0 */)
{
std::string sfiles = files;
std::string destination = dest;
@@ -303,7 +323,12 @@ void cmLocalGenerator::AddInstallRule(std::ostream& fout, const char* dest,
<< "MESSAGE(STATUS \"Installing " << destination.c_str()
<< "/" << fname.c_str() << "\")\n"
<< "FILE(INSTALL DESTINATION \"" << destination.c_str()
- << "\" TYPE " << stype.c_str() << (optional?" OPTIONAL":"")
+ << "\" TYPE " << stype.c_str() << (optional?" OPTIONAL":"") ;
+ if ( properties && *properties )
+ {
+ fout << " PROPERTIES" << properties;
+ }
+ fout
<< " FILES \"" << sfiles.c_str() << "\")\n";
}