Commit 4db1cd9 for zlib
commit 4db1cd9721f2a404a53edaa48a688db251d1daf5
Author: Vollstrecker <werner@vollstreckernet.de>
Date: Wed Dec 31 11:11:28 2025 +0100
CMake: Added contrib/iostream3.
diff --git a/contrib/CMakeLists.txt b/contrib/CMakeLists.txt
index cf5c1e0..13fe2d4 100644
--- a/contrib/CMakeLists.txt
+++ b/contrib/CMakeLists.txt
@@ -1,5 +1,6 @@
option(ZLIB_BUILD_ADA "Enable building of Ada bindings" OFF)
option(ZLIB_BUILD_BLAST "Enable building of blast binary" OFF)
+option(ZLIB_BUILD_IOSTREAM3 "Build with IOStream C++ bindings V3" OFF)
option(ZLIB_BUILD_MINIZIP "Enable building libminizip contrib library" OFF)
option(ZLIB_WITH_GVMAT64
"Enable an optiomized longest_match for 32 bits x86_64"
@@ -30,6 +31,14 @@ endif(ZLIB_BUILD_MINIZIP)
if(ZLIB_WITH_GVMAT64)
add_subdirectory(gcc_gvmat64/)
endif(ZLIB_WITH_GVMAT64)
+
if(ZLIB_WITH_INFBACK9)
add_subdirectory(infback9/)
endif(ZLIB_WITH_INFBACK9)
+
+if(ZLIB_BUILD_IOSTREAM3)
+ set(ZLIB_IOSTREAM3_BUILD_SHARED ${ZLIB_BUILD_SHARED})
+ set(ZLIB_IOSTREAM3_BUILD_STATIC ${ZLIB_BUILD_STATIC})
+ set(ZLIB_IOSTREAM3_TESTING ${ZLIB_BUILD_TESTING})
+ add_subdirectory(iostream3/)
+endif(ZLIB_BUILD_IOSTREAM3)
diff --git a/contrib/ada/CMakeLists.txt b/contrib/ada/CMakeLists.txt
index cb8b156..3ede5f9 100644
--- a/contrib/ada/CMakeLists.txt
+++ b/contrib/ada/CMakeLists.txt
@@ -14,7 +14,7 @@ option(ZLIB_ADA_BUILD_STATIC "Enable building ada bindings static library" ON)
option(ZLIB_ADA_BUILD_TESTING "Enable building tests for ada bindings library" ON)
if(WIN32 OR CYGWIN)
- set(zlibAda_static_suffix "s")
+ set(zlib_Ada_static_suffix "s")
set(CMAKE_DEBUG_POSTFIX "d")
endif(WIN32 OR CYGWIN)
@@ -150,7 +150,7 @@ if(ZLIB_ADA_BUILD_STATIC)
INTERFACE ZLIB::ZLIBSTATIC)
set_target_properties(zlib-AdaStatic
- PROPERTIES OUTPUT_NAME zlib-Ada${zlibAda_static_suffix})
+ PROPERTIES OUTPUT_NAME zlib-Ada${zlib_Ada_static_suffix})
ada_add_library(zlib-streamsStatic STATIC
zlib-streams.adb)
diff --git a/contrib/iostream3/CMakeLists.txt b/contrib/iostream3/CMakeLists.txt
new file mode 100644
index 0000000..0f3bcd8
--- /dev/null
+++ b/contrib/iostream3/CMakeLists.txt
@@ -0,0 +1,92 @@
+cmake_minimum_required(VERSION 3.12...3.31)
+
+set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules")
+
+project(
+ iostreamsV3
+ VERSION 1.0.0
+ LANGUAGES CXX
+ DESCRIPTION "A library for using C++ IOStreams with zlib V3"
+ HOMEPAGE_URL "https://www.zlib.net")
+
+option(ZLIB_IOSTREAM3_BUILD_SHARED "Enable building blast shared library" ON)
+option(ZLIB_IOSTREAM3_BUILD_STATIC "Enable building blast static library" ON)
+option(ZLIB_IOSTREAM3_BUILD_TESTING "Enable building tests for blast" ON)
+
+if(NOT DEFINED ZLIB_BUILD_IOSTREAM3)
+ if(ZLIB_IOSTREAM3_BUILD_SHARED)
+ list(APPEND REQUIRED_COMPONENTS "shared")
+ endif(ZLIB_IOSTREAM3_BUILD_SHARED)
+
+ if(ZLIB_IOSTREAM3_BUILD_STATIC)
+ list(APPEND REQUIRED_COMPONENTS "static")
+ endif(ZLIB_IOSTREAM3_BUILD_STATIC)
+
+ find_package(ZLIB REQUIRED COMPONENTS ${REQUIRED_COMPONENTS} CONFIG)
+endif(NOT DEFINED ZLIB_BUILD_IOSTREAM3)
+
+if(WIN32 OR CYGWIN)
+ set(zlibIOStream3_static_suffix "s")
+ set(CMAKE_DEBUG_POSTFIX "d")
+endif(WIN32 OR CYGWIN)
+
+if(ZLIB_IOSTREAM3_BUILD_SHARED)
+ add_library(zlib-iostream3 SHARED
+ zfstream.cc
+ zfstream.h)
+
+ target_link_libraries(zlib-iostream3
+ PUBLIC ZLIB::ZLIB)
+
+ if(ZLIB_IOSTREAM3_BUILD_TESTING)
+ enable_testing()
+
+ add_executable(iostream-test test.cc)
+
+ target_link_libraries(iostream-test
+ PRIVATE zlib-iostream3)
+
+ add_test(NAME zlib_iostream3_test COMMAND iostream-test)
+
+ set_tests_properties(zlib_iostream3_test
+ PROPERTIES
+ FIXTURES_REQUIRED iostream3_cleanup)
+ endif(ZLIB_IOSTREAM3_BUILD_TESTING)
+endif(ZLIB_IOSTREAM3_BUILD_SHARED)
+
+if(ZLIB_IOSTREAM3_BUILD_STATIC)
+ add_library(zlib-iostream3Static STATIC
+ zfstream.cc
+ zfstream.h)
+
+ target_link_libraries(zlib-iostream3Static
+ INTERFACE ZLIB::ZLIBSTATIC)
+
+ set_target_properties(zlib-iostream3Static
+ PROPERTIES
+ OUTPUT_NAME zlib-iostream3${zlib_IOStream3_static_suffix})
+
+ if(ZLIB_IOSTREAM3_BUILD_TESTING)
+ enable_testing()
+
+ add_executable(iostream-testStatic test.cc)
+
+ target_link_libraries(iostream-testStatic
+ PRIVATE zlib-iostream3Static)
+ add_test(NAME zlib_iostream3_testStatic COMMAND iostream-testStatic)
+
+ set_tests_properties(zlib_iostream3_testStatic
+ PROPERTIES
+ FIXTURES_REQUIRED iostream3_cleanup)
+ endif(ZLIB_IOSTREAM3_BUILD_TESTING)
+endif(ZLIB_IOSTREAM3_BUILD_STATIC)
+
+if(ZLIB_IOSTREAM3_BUILD_TESTING)
+ add_test(NAME zlib_iostream3_cleanup COMMAND ${CMAKE_COMMAND} -E rm
+ ${CMAKE_CURRENT_BINARY_DIR}/test1.txt.gz
+ ${CMAKE_CURRENT_BINARY_DIR}/test2.txt.gz)
+
+ set_tests_properties(zlib_iostream3_cleanup
+ PROPERTIES
+ FIXTURES_CLEANUP zlib_iostream3_cleanup)
+endif(ZLIB_IOSTREAM3_BUILD_TESTING)