diff options
| author | Vollstrecker <werner@vollstreckernet.de> | 2026-01-03 10:57:00 +0100 |
|---|---|---|
| committer | Mark Adler <git@madler.net> | 2026-01-12 11:09:28 -0800 |
| commit | 9444f8641b3dc9f3de11caa2d852400bf4776a22 (patch) | |
| tree | e0984390168466f570b855ae875d3322c4c844ce | |
| parent | 39728a2b005fa549307943a3ed00afa878ab9a65 (diff) | |
| download | zlib-9444f8641b3dc9f3de11caa2d852400bf4776a22.tar.gz zlib-9444f8641b3dc9f3de11caa2d852400bf4776a22.tar.bz2 zlib-9444f8641b3dc9f3de11caa2d852400bf4776a22.zip | |
CMake: Make it work with add_subdirectory.
| -rw-r--r-- | contrib/blast/CMakeLists.txt | 21 | ||||
| -rw-r--r-- | contrib/iostream3/CMakeLists.txt | 22 | ||||
| -rw-r--r-- | contrib/puff/CMakeLists.txt | 17 |
3 files changed, 55 insertions, 5 deletions
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) | |||
| 40 | blast.c | 40 | blast.c |
| 41 | blast.h) | 41 | blast.h) |
| 42 | 42 | ||
| 43 | add_library(BLAST::BLAST ALIAS zlib_blast_blast) | ||
| 44 | |||
| 45 | if(NOT CYGWIN) | ||
| 46 | set_target_properties(zlib_blast_blast | ||
| 47 | PROPERTIES | ||
| 48 | SOVERSION ${blast_VERSION_MAJOR} | ||
| 49 | VERSION ${blast_VERSION}) | ||
| 50 | endif(NOT CYGWIN) | ||
| 51 | |||
| 52 | set_target_properties(zlib_blast_blast | ||
| 53 | PROPERTIES | ||
| 54 | EXPORT_NAME BLAST | ||
| 55 | OUTPUT_NAME blast) | ||
| 56 | |||
| 43 | if(ZLIB_BLAST_BUILD_TESTING) | 57 | if(ZLIB_BLAST_BUILD_TESTING) |
| 44 | enable_testing() | 58 | enable_testing() |
| 45 | add_executable(blast-test blast-test.c) | 59 | add_executable(blast-test blast-test.c) |
| @@ -69,9 +83,12 @@ if(ZLIB_BLAST_BUILD_STATIC) | |||
| 69 | blast.c | 83 | blast.c |
| 70 | blast.h) | 84 | blast.h) |
| 71 | 85 | ||
| 72 | set_target_properties(blastStatic | 86 | add_library(BLAST::BLASTSTATIC ALIAS zlib_blast_blastStatic) |
| 87 | |||
| 88 | set_target_properties(zlib_blast_blastStatic | ||
| 73 | PROPERTIES | 89 | PROPERTIES |
| 74 | OUTPUT_NAME blast${minizip_static_suffix}) | 90 | EXPORT_NAME BLASTSTATIC |
| 91 | OUTPUT_NAME blast${zlibblast_static_suffix}) | ||
| 75 | 92 | ||
| 76 | if(ZLIB_BLAST_BUILD_TESTING) | 93 | if(ZLIB_BLAST_BUILD_TESTING) |
| 77 | enable_testing() | 94 | 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) | |||
| 37 | zfstream.cc | 37 | zfstream.cc |
| 38 | zfstream.h) | 38 | zfstream.h) |
| 39 | 39 | ||
| 40 | target_link_libraries(zlib-iostream3 | 40 | add_library(IOSTREAMV3::IOSTREAMV3 ALIAS zlib_iostream3_iostreamv3) |
| 41 | |||
| 42 | if(NOT CYGWIN) | ||
| 43 | set_target_properties(zlib_iostream3_iostreamv3 | ||
| 44 | PROPERTIES | ||
| 45 | SOVERSION ${iostreamV3_VERSION_MAJOR} | ||
| 46 | VERSION ${iostreamV3_VERSION}) | ||
| 47 | endif(NOT CYGWIN) | ||
| 48 | |||
| 49 | set_target_properties( | ||
| 50 | zlib_iostream3_iostreamv3 | ||
| 51 | PROPERTIES | ||
| 52 | EXPORT_NAME IOSTREAMV3 | ||
| 53 | OUTPUT_NAME iostream3) | ||
| 54 | |||
| 55 | target_link_libraries(zlib_iostream3_iostreamv3 | ||
| 41 | PUBLIC ZLIB::ZLIB) | 56 | PUBLIC ZLIB::ZLIB) |
| 42 | 57 | ||
| 43 | if(ZLIB_IOSTREAM3_BUILD_TESTING) | 58 | if(ZLIB_IOSTREAM3_BUILD_TESTING) |
| @@ -61,7 +76,10 @@ if(ZLIB_IOSTREAM3_BUILD_STATIC) | |||
| 61 | zfstream.cc | 76 | zfstream.cc |
| 62 | zfstream.h) | 77 | zfstream.h) |
| 63 | 78 | ||
| 64 | target_link_libraries(zlib-iostream3Static | 79 | add_library(IOSTREAMV3::IOSTREAMV3STATIC |
| 80 | ALIAS zlib_iostream3_iostreamv3Static) | ||
| 81 | |||
| 82 | target_link_libraries(zlib_iostream3_iostreamv3Static | ||
| 65 | INTERFACE ZLIB::ZLIBSTATIC) | 83 | INTERFACE ZLIB::ZLIBSTATIC) |
| 66 | 84 | ||
| 67 | set_target_properties(zlib-iostream3Static | 85 | 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) | |||
| 66 | puff.c | 66 | puff.c |
| 67 | puff.h) | 67 | puff.h) |
| 68 | 68 | ||
| 69 | add_library(PUFF::PUFF ALIAS zlib_puff_puff) | ||
| 70 | |||
| 71 | if(NOT CYGWIN) | ||
| 72 | set_target_properties(zlib_puff_puff | ||
| 73 | PROPERTIES | ||
| 74 | SOVERSION ${puff_VERSION_MAJOR} | ||
| 75 | VERSION ${puff_VERSION}) | ||
| 76 | endif(NOT CYGWIN) | ||
| 77 | |||
| 78 | set_target_properties( | ||
| 79 | zlib_puff_puff | ||
| 80 | PROPERTIES | ||
| 81 | EXPORT_NAME PUFF | ||
| 82 | OUTPUT_NAME puff) | ||
| 83 | |||
| 69 | if(ZLIB_PUFF_BUILD_TESTING) | 84 | if(ZLIB_PUFF_BUILD_TESTING) |
| 70 | enable_testing() | 85 | enable_testing() |
| 71 | 86 | ||
| @@ -104,7 +119,7 @@ if(ZLIB_PUFF_BUILD_STATIC) | |||
| 104 | puff.c | 119 | puff.c |
| 105 | puff.h) | 120 | puff.h) |
| 106 | 121 | ||
| 107 | set_target_properties(zlib-puffStatic | 122 | add_library(PUFF::PUFFSTATIC ALIAS zlib_puff_puffStatic) |
| 108 | PROPERTIES | 123 | PROPERTIES |
| 109 | OUTPUT_NAME zlib-puff${zlib_puff_static_suffix}) | 124 | OUTPUT_NAME zlib-puff${zlib_puff_static_suffix}) |
| 110 | 125 | ||
