From e0b78cea4f5e526da33eeebfaa0d06a6fcd70aee Mon Sep 17 00:00:00 2001 From: Vollstrecker Date: Thu, 5 Dec 2024 12:31:33 +0100 Subject: CMake: Name the shared library cygz.dll on Cygwin. --- CMakeLists.txt | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 545dafe..4aaf62b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -113,19 +113,18 @@ if(ZLIB_BUILD_SHARED) $<$:NO_FSEEKO> $<$:_CRT_SECURE_NO_DEPRECATE> $<$:_CRT_NONSTDC_NO_DEPRECATE>) - # The VERSION property causes shared libraries on Linux to have the full version - # encoded into their final filename. We disable this on Cygwin because - # it causes cygz-${ZLIB_FULL_VERSION}.dll to be created when cygz.dll - # seems to be the default. - # - # This has no effect with MSVC, on that platform the version info for - # the DLL comes from the resource file win32/zlib1.rc + set(INSTALL_VERSION ${zlib_VERSION_MAJOR}) + + if(NOT CYGWIN) + set_target_properties(zlib PROPERTIES + SOVERSION ${zlib_VERSION_MAJOR} + VERSION ${INSTALL_VERSION}) + endif(NOT CYGWIN) + set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL EXPORT_NAME ZLIB - OUTPUT_NAME z - SOVERSION 1 - $<$:VERSION ${zlib_VERSION}>) + OUTPUT_NAME z) if(UNIX AND NOT APPLE AND NOT(CMAKE_SYSTEM_NAME STREQUAL AIX)) # On unix-like platforms the library is almost always called libz set_target_properties(zlib PROPERTIES -- cgit v1.2.3-55-g6feb