Commit 9444f86 for zlib
commit 9444f8641b3dc9f3de11caa2d852400bf4776a22
Author: Vollstrecker <werner@vollstreckernet.de>
Date: Sat Jan 3 10:57:00 2026 +0100
CMake: Make it work with add_subdirectory.
diff --git a/contrib/blast/CMakeLists.txt b/contrib/blast/CMakeLists.txt
index b1a9065..a917eb8 100644
--- a/contrib/blast/CMakeLists.txt
+++ b/contrib/blast/CMakeLists.txt
@@ -40,6 +40,20 @@ if(ZLIB_BLAST_BUILD_SHARED)
blast.c
blast.h)
+ add_library(BLAST::BLAST ALIAS zlib_blast_blast)
+
+ if(NOT CYGWIN)
+ set_target_properties(zlib_blast_blast
+ PROPERTIES
+ SOVERSION ${blast_VERSION_MAJOR}
+ VERSION ${blast_VERSION})
+ endif(NOT CYGWIN)
+
+ set_target_properties(zlib_blast_blast
+ PROPERTIES
+ EXPORT_NAME BLAST
+ OUTPUT_NAME blast)
+
if(ZLIB_BLAST_BUILD_TESTING)
enable_testing()
add_executable(blast-test blast-test.c)
@@ -69,9 +83,12 @@ if(ZLIB_BLAST_BUILD_STATIC)
blast.c
blast.h)
- set_target_properties(blastStatic
+ add_library(BLAST::BLASTSTATIC ALIAS zlib_blast_blastStatic)
+
+ set_target_properties(zlib_blast_blastStatic
PROPERTIES
- OUTPUT_NAME blast${minizip_static_suffix})
+ EXPORT_NAME BLASTSTATIC
+ OUTPUT_NAME blast${zlibblast_static_suffix})
if(ZLIB_BLAST_BUILD_TESTING)
enable_testing()
diff --git a/contrib/iostream3/CMakeLists.txt b/contrib/iostream3/CMakeLists.txt
index 01bc279..65f19e5 100644
--- a/contrib/iostream3/CMakeLists.txt
+++ b/contrib/iostream3/CMakeLists.txt
@@ -37,7 +37,22 @@ if(ZLIB_IOSTREAM3_BUILD_SHARED)
zfstream.cc
zfstream.h)
- target_link_libraries(zlib-iostream3
+ add_library(IOSTREAMV3::IOSTREAMV3 ALIAS zlib_iostream3_iostreamv3)
+
+ if(NOT CYGWIN)
+ set_target_properties(zlib_iostream3_iostreamv3
+ PROPERTIES
+ SOVERSION ${iostreamV3_VERSION_MAJOR}
+ VERSION ${iostreamV3_VERSION})
+ endif(NOT CYGWIN)
+
+ set_target_properties(
+ zlib_iostream3_iostreamv3
+ PROPERTIES
+ EXPORT_NAME IOSTREAMV3
+ OUTPUT_NAME iostream3)
+
+ target_link_libraries(zlib_iostream3_iostreamv3
PUBLIC ZLIB::ZLIB)
if(ZLIB_IOSTREAM3_BUILD_TESTING)
@@ -61,7 +76,10 @@ if(ZLIB_IOSTREAM3_BUILD_STATIC)
zfstream.cc
zfstream.h)
- target_link_libraries(zlib-iostream3Static
+ add_library(IOSTREAMV3::IOSTREAMV3STATIC
+ ALIAS zlib_iostream3_iostreamv3Static)
+
+ target_link_libraries(zlib_iostream3_iostreamv3Static
INTERFACE ZLIB::ZLIBSTATIC)
set_target_properties(zlib-iostream3Static
diff --git a/contrib/puff/CMakeLists.txt b/contrib/puff/CMakeLists.txt
index 1696c76..0733d43 100644
--- a/contrib/puff/CMakeLists.txt
+++ b/contrib/puff/CMakeLists.txt
@@ -66,6 +66,21 @@ if(ZLIB_PUFF_BUILD_SHARED)
puff.c
puff.h)
+ add_library(PUFF::PUFF ALIAS zlib_puff_puff)
+
+ if(NOT CYGWIN)
+ set_target_properties(zlib_puff_puff
+ PROPERTIES
+ SOVERSION ${puff_VERSION_MAJOR}
+ VERSION ${puff_VERSION})
+ endif(NOT CYGWIN)
+
+ set_target_properties(
+ zlib_puff_puff
+ PROPERTIES
+ EXPORT_NAME PUFF
+ OUTPUT_NAME puff)
+
if(ZLIB_PUFF_BUILD_TESTING)
enable_testing()
@@ -104,7 +119,7 @@ if(ZLIB_PUFF_BUILD_STATIC)
puff.c
puff.h)
- set_target_properties(zlib-puffStatic
+ add_library(PUFF::PUFFSTATIC ALIAS zlib_puff_puffStatic)
PROPERTIES
OUTPUT_NAME zlib-puff${zlib_puff_static_suffix})