diff options
| author | Vollstrecker <werner@vollstreckernet.de> | 2025-12-31 13:56:08 +0100 |
|---|---|---|
| committer | Mark Adler <git@madler.net> | 2026-01-12 10:55:15 -0800 |
| commit | 1956b5a89f24a11647edf1c2625b2830cd1e16bc (patch) | |
| tree | 2740e9fe54475710f5cf36f2417ffd15ed7c9bda | |
| parent | 4db1cd9721f2a404a53edaa48a688db251d1daf5 (diff) | |
| download | zlib-1956b5a89f24a11647edf1c2625b2830cd1e16bc.tar.gz zlib-1956b5a89f24a11647edf1c2625b2830cd1e16bc.tar.bz2 zlib-1956b5a89f24a11647edf1c2625b2830cd1e16bc.zip | |
CMake: Moved everything to functions for consistency.
| -rw-r--r-- | contrib/CMakeLists.txt | 83 |
1 files changed, 39 insertions, 44 deletions
diff --git a/contrib/CMakeLists.txt b/contrib/CMakeLists.txt index 13fe2d4..18f86c4 100644 --- a/contrib/CMakeLists.txt +++ b/contrib/CMakeLists.txt | |||
| @@ -1,44 +1,39 @@ | |||
| 1 | option(ZLIB_BUILD_ADA "Enable building of Ada bindings" OFF) | 1 | function(zlib_add_contrib_lib name description dir) |
| 2 | option(ZLIB_BUILD_BLAST "Enable building of blast binary" OFF) | 2 | option(ZLIB_BUILD_${name} "Enable building of ${description}" OFF) |
| 3 | option(ZLIB_BUILD_IOSTREAM3 "Build with IOStream C++ bindings V3" OFF) | 3 | |
| 4 | option(ZLIB_BUILD_MINIZIP "Enable building libminizip contrib library" OFF) | 4 | if(ZLIB_BUILD_${name}) |
| 5 | option(ZLIB_WITH_GVMAT64 | 5 | if(NOT DEFINED ZLIB_${name}_BUILD_SHARED) |
| 6 | "Enable an optiomized longest_match for 32 bits x86_64" | 6 | set(ZLIB_${name}_BUILD_SHARED ${ZLIB_BUILD_SHARED}) |
| 7 | OFF) | 7 | endif(NOT DEFINED ZLIB_${name}_BUILD_SHARED) |
| 8 | option(ZLIB_WITH_INFBACK9 "Build with support for method 9 deflate" OFF) | 8 | |
| 9 | 9 | if(NOT DEFINED ZLIB_${name}_BUILD_STATIC) | |
| 10 | if(ZLIB_BUILD_ADA) | 10 | set(ZLIB_${name}_BUILD_STATIC ${ZLIB_BUILD_STATIC}) |
| 11 | set(ZLIB_ADA_BUILD_SHARED ${ZLIB_BUILD_SHARED}) | 11 | endif(NOT DEFINED ZLIB_${name}_BUILD_STATIC) |
| 12 | set(ZLIB_ADA_BUILD_STATIC ${ZLIB_BUILD_STATIC}) | 12 | |
| 13 | set(ZLIB_ADA_BUILD_TESTING ${ZLIB_BUILD_TESTING}) | 13 | if(NOT DEFINED ZLIB_${name}_BUILD_TESTING) |
| 14 | add_subdirectory(ada/) | 14 | set(ZLIB_${name}_BUILD_TESTING ${ZLIB_BUILD_TESTING}) |
| 15 | endif(ZLIB_BUILD_ADA) | 15 | endif(NOT DEFINED ZLIB_${name}_BUILD_TESTING) |
| 16 | 16 | ||
| 17 | if(ZLIB_BUILD_BLAST) | 17 | add_subdirectory(${dir}/) |
| 18 | set(ZLIB_BLAST_BUILD_SHARED ${ZLIB_BUILD_SHARED}) | 18 | endif(ZLIB_BUILD_${name}) |
| 19 | set(ZLIB_BLAST_BUILD_STATIC ${ZLIB_BUILD_STATIC}) | 19 | endfunction(zlib_add_contrib_lib name description dir) |
| 20 | set(ZLIB_BLAST_BUILD_TESTING ${ZLIB_BUILD_TESTING}) | 20 | |
| 21 | add_subdirectory(blast/) | 21 | function(zlib_add_contrib_feature name description dir) |
| 22 | endif(ZLIB_BUILD_BLAST) | 22 | option(ZLIB_WITH_${name} |
| 23 | 23 | "Enable build ${description}" | |
| 24 | if(ZLIB_BUILD_MINIZIP) | 24 | OFF) |
| 25 | set(MINIZIP_BUILD_SHARED ${ZLIB_BUILD_SHARED}) | 25 | |
| 26 | set(MINIZIP_BUILD_STATIC ${ZLIB_BUILD_STATIC}) | 26 | if(ZLIB_WITH_${name}) |
| 27 | set(MINIZIP_BUILD_TESTING ${ZLIB_BUILD_TESTING}) | 27 | add_subdirectory(${dir}/) |
| 28 | add_subdirectory(minizip/) | 28 | endif(ZLIB_WITH_${name}) |
| 29 | endif(ZLIB_BUILD_MINIZIP) | 29 | endfunction(zlib_add_contrib_feature name description dir) |
| 30 | 30 | ||
| 31 | if(ZLIB_WITH_GVMAT64) | 31 | zlib_add_contrib_feature("GVMAT64" |
| 32 | add_subdirectory(gcc_gvmat64/) | 32 | "of an optimized longest_match for 32 bits x86_64" |
| 33 | endif(ZLIB_WITH_GVMAT64) | 33 | gcc_gvmat64) |
| 34 | 34 | ||
| 35 | if(ZLIB_WITH_INFBACK9) | 35 | zlib_add_contrib_feature(INFBACK9 "with support for method 9 deflate" infback9) |
| 36 | add_subdirectory(infback9/) | 36 | zlib_add_contrib_lib(ADA "Ada bindings" ada) |
| 37 | endif(ZLIB_WITH_INFBACK9) | 37 | zlib_add_contrib_lib(BLAST "blast binary" blast) |
| 38 | 38 | zlib_add_contrib_lib(IOSTREAM3 "IOStream C++ bindings V3" iostream3) | |
| 39 | if(ZLIB_BUILD_IOSTREAM3) | 39 | zlib_add_contrib_lib(MINIZIP "minizip library" minizip) |
| 40 | set(ZLIB_IOSTREAM3_BUILD_SHARED ${ZLIB_BUILD_SHARED}) | ||
| 41 | set(ZLIB_IOSTREAM3_BUILD_STATIC ${ZLIB_BUILD_STATIC}) | ||
| 42 | set(ZLIB_IOSTREAM3_TESTING ${ZLIB_BUILD_TESTING}) | ||
| 43 | add_subdirectory(iostream3/) | ||
| 44 | endif(ZLIB_BUILD_IOSTREAM3) | ||
