ENH: Adding version number to the name of a DLL built in cygwin but not the import library. This addresses bug#3571.

This commit is contained in:
Brad King 2006-10-05 16:30:47 -04:00
parent 48470eaa00
commit e0a662a3dd
2 changed files with 14 additions and 0 deletions

View File

@ -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

View File

@ -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:"";
}