summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-10-05 20:30:47 (GMT)
committerBrad King <brad.king@kitware.com>2006-10-05 20:30:47 (GMT)
commite0a662a3ddfe3c906f81b0a070e4de169e46646e (patch)
treed2d48e7ae58604b3e09f3ad239ffadab2c55ee8c
parent48470eaa0072d1ce6e4f407c014d18197f4cd5c3 (diff)
downloadCMake-e0a662a3ddfe3c906f81b0a070e4de169e46646e.zip
CMake-e0a662a3ddfe3c906f81b0a070e4de169e46646e.tar.gz
CMake-e0a662a3ddfe3c906f81b0a070e4de169e46646e.tar.bz2
ENH: Adding version number to the name of a DLL built in cygwin but not the import library. This addresses bug#3571.
-rw-r--r--Modules/Platform/CYGWIN.cmake3
-rw-r--r--Source/cmTarget.cxx11
2 files changed, 14 insertions, 0 deletions
diff --git a/Modules/Platform/CYGWIN.cmake b/Modules/Platform/CYGWIN.cmake
index 0d508f0..fe34bfc 100644
--- a/Modules/Platform/CYGWIN.cmake
+++ b/Modules/Platform/CYGWIN.cmake
@@ -28,6 +28,9 @@ SET(CMAKE_C_CREATE_SHARED_LIBRARY
SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
"<CMAKE_CXX_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> -o <TARGET> -Wl,--out-implib,<TARGET_IMPLIB> <OBJECTS> <LINK_LIBRARIES>")
+# Shared libraries on cygwin can be named with their version number.
+SET(CMAKE_SHARED_LIBRARY_NAME_WITH_VERSION 1)
+
# Initialize C link type selection flags. These flags are used when
# building a shared library, shared module, or executable that links
# to other libraries to select whether to use the static or shared
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 24e196a..9ac85ee 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -1255,6 +1255,17 @@ void cmTarget::GetFullNameInternal(TargetType type,
// Append the per-configuration postfix.
outBase += configPostfix?configPostfix:"";
+ // Name shared libraries with their version number on some platforms.
+ if(const char* version = this->GetProperty("VERSION"))
+ {
+ if(type == cmTarget::SHARED_LIBRARY && !implib &&
+ this->Makefile->IsOn("CMAKE_SHARED_LIBRARY_NAME_WITH_VERSION"))
+ {
+ outBase += "-";
+ outBase += version;
+ }
+ }
+
// Append the suffix.
outSuffix = targetSuffix?targetSuffix:"";
}