diff options
author | Brad King <brad.king@kitware.com> | 2006-08-01 19:36:49 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2006-08-01 19:36:49 (GMT) |
commit | c9506c30f0b9524e1eeee8a7c0176203218ed310 (patch) | |
tree | 0520ab4913ecb3216e5ea13ae310e0e427b80815 | |
parent | e0e32400af0edf7c621ca087377a8088b9b4d486 (diff) | |
download | CMake-c9506c30f0b9524e1eeee8a7c0176203218ed310.zip CMake-c9506c30f0b9524e1eeee8a7c0176203218ed310.tar.gz CMake-c9506c30f0b9524e1eeee8a7c0176203218ed310.tar.bz2 |
BUG: Fixed shared library version support for Fortran. This addresses bug#3558.
-rw-r--r-- | Modules/Platform/Linux.cmake | 1 | ||||
-rw-r--r-- | Source/cmInstallTargetGenerator.cxx | 25 |
2 files changed, 18 insertions, 8 deletions
diff --git a/Modules/Platform/Linux.cmake b/Modules/Platform/Linux.cmake index 6ae2ed5..9174eb6 100644 --- a/Modules/Platform/Linux.cmake +++ b/Modules/Platform/Linux.cmake @@ -7,4 +7,5 @@ SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,") SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":") SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,") SET(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG "-Wl,-soname,") +SET(CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG "-Wl,-soname,") INCLUDE(Platform/UnixPaths) diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index 7ad7825..1fd32fd 100644 --- a/Source/cmInstallTargetGenerator.cxx +++ b/Source/cmInstallTargetGenerator.cxx @@ -81,16 +81,25 @@ void cmInstallTargetGenerator::GenerateScript(std::ostream& os) { // Add shared library installation properties if this platform // supports them. - const char* lib_version = this->Target->GetProperty("VERSION"); - const char* lib_soversion = this->Target->GetProperty("SOVERSION"); - if(!this->Target->GetMakefile() - ->GetDefinition("CMAKE_SHARED_LIBRARY_SONAME_C_FLAG")) + const char* lib_version = 0; + const char* lib_soversion = 0; + + // Versioning is supported only for shared libraries and modules, + // and then only when the platform supports an soname flag. + cmGlobalGenerator* gg = + this->Target->GetMakefile()->GetLocalGenerator()->GetGlobalGenerator(); + if(const char* linkLanguage = this->Target->GetLinkerLanguage(gg)) { - // 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; + std::string sonameFlagVar = "CMAKE_SHARED_LIBRARY_SONAME_"; + sonameFlagVar += linkLanguage; + sonameFlagVar += "_FLAG"; + if(this->Target->GetMakefile()->GetDefinition(sonameFlagVar.c_str())) + { + lib_version = this->Target->GetProperty("VERSION"); + lib_soversion = this->Target->GetProperty("SOVERSION"); + } } + if(lib_version) { props += " VERSION "; |