aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVollstrecker <werner@vollstreckernet.de>2024-12-01 17:49:30 +0100
committerMark Adler <madler@alumni.caltech.edu>2025-01-31 19:59:10 -0800
commitc33f3bc641f327adb65b2c98b1cdb166c9860e9d (patch)
treedfb53cf2c43355ef3e927711eb03f9ff81074bf0
parentb6cb6f4c213d9a8d58f996552d2652baa5ee550d (diff)
downloadzlib-c33f3bc641f327adb65b2c98b1cdb166c9860e9d.tar.gz
zlib-c33f3bc641f327adb65b2c98b1cdb166c9860e9d.tar.bz2
zlib-c33f3bc641f327adb65b2c98b1cdb166c9860e9d.zip
CMake: Move version setting for Cygwin into set_target_properties.
Diffstat (limited to '')
-rw-r--r--CMakeLists.txt22
1 files changed, 9 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3cd986b..28a4c3f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,7 +18,6 @@ include(CheckFunctionExists)
18include(CheckIncludeFile) 18include(CheckIncludeFile)
19include(CheckCSourceCompiles) 19include(CheckCSourceCompiles)
20include(GNUInstallDirs) 20include(GNUInstallDirs)
21enable_testing()
22 21
23# 22#
24# Check to see if we have large file support 23# Check to see if we have large file support
@@ -104,11 +103,19 @@ if(ZLIB_BUILD_SHARED)
104 $<$<BOOL:NOT:${HAVE_FSEEKO}>:NO_FSEEKO> 103 $<$<BOOL:NOT:${HAVE_FSEEKO}>:NO_FSEEKO>
105 $<$<BOOL:${MSVC}>:_CRT_SECURE_NO_DEPRECATE> 104 $<$<BOOL:${MSVC}>:_CRT_SECURE_NO_DEPRECATE>
106 $<$<BOOL:${MSVC}>:_CRT_NONSTDC_NO_DEPRECATE>) 105 $<$<BOOL:${MSVC}>:_CRT_NONSTDC_NO_DEPRECATE>)
106 # The VERSION property causes shared libraries on Linux to have the full version
107 # encoded into their final filename. We disable this on Cygwin because
108 # it causes cygz-${ZLIB_FULL_VERSION}.dll to be created when cygz.dll
109 # seems to be the default.
110 #
111 # This has no effect with MSVC, on that platform the version info for
112 # the DLL comes from the resource file win32/zlib1.rc
107 set_target_properties(zlib PROPERTIES 113 set_target_properties(zlib PROPERTIES
108 DEFINE_SYMBOL ZLIB_DLL 114 DEFINE_SYMBOL ZLIB_DLL
109 SOVERSION 1 115 SOVERSION 1
110 PROPERTIES OUTPUT_NAME z 116 PROPERTIES OUTPUT_NAME z
111 PROPERTIES OUTPUT_NAME_DEBUG z${zlib_debug_suffix}) 117 PROPERTIES OUTPUT_NAME_DEBUG z${zlib_debug_suffix}
118 $<$<BOOL:NOT:$CYGWIN}>:VERSION ${zlib_VERSION}>)
112 if(UNIX AND NOT APPLE AND NOT(CMAKE_SYSTEM_NAME STREQUAL AIX)) 119 if(UNIX AND NOT APPLE AND NOT(CMAKE_SYSTEM_NAME STREQUAL AIX))
113 # On unix-like platforms the library is almost always called libz 120 # On unix-like platforms the library is almost always called libz
114 set_target_properties(zlib PROPERTIES 121 set_target_properties(zlib PROPERTIES
@@ -136,17 +143,6 @@ if(ZLIB_BUILD_STATIC)
136 PROPERTIES OUTPUT_NAME_DEBUG z${zlib_static_suffix}${zlib_debug_suffix}) 143 PROPERTIES OUTPUT_NAME_DEBUG z${zlib_static_suffix}${zlib_debug_suffix})
137endif(ZLIB_BUILD_STATIC) 144endif(ZLIB_BUILD_STATIC)
138 145
139if(NOT CYGWIN AND ZLIB_BUILD_SHARED)
140 # This property causes shared libraries on Linux to have the full version
141 # encoded into their final filename. We disable this on Cygwin because
142 # it causes cygz-${ZLIB_FULL_VERSION}.dll to be created when cygz.dll
143 # seems to be the default.
144 #
145 # This has no effect with MSVC, on that platform the version info for
146 # the DLL comes from the resource file win32/zlib1.rc
147 set_target_properties(zlib PROPERTIES VERSION ${zlib_VERSION})
148endif(NOT CYGWIN AND ZLIB_BUILD_SHARED)
149
150if(ZLIB_INSTALL_LIBRARIES) 146if(ZLIB_INSTALL_LIBRARIES)
151 if(ZLIB_BUILD_SHARED) 147 if(ZLIB_BUILD_SHARED)
152 install(TARGETS zlib 148 install(TARGETS zlib