Commit edd8895 for zlib
commit edd88953de3a8560b0925ad0637490925f086317
Author: Vollstrecker <werner@vollstreckernet.de>
Date: Sun Jan 4 14:26:33 2026 +0100
CMake: Add install-target for contrib/testzlib.
diff --git a/contrib/testzlib/CMakeLists.txt b/contrib/testzlib/CMakeLists.txt
index d68b533..b710c76 100644
--- a/contrib/testzlib/CMakeLists.txt
+++ b/contrib/testzlib/CMakeLists.txt
@@ -9,14 +9,36 @@ project(
option(ZLIB_TESTZLIB_BUILD_SHARED "Enable building testzlib" ON)
option(ZLIB_TESTZLIB_BUILD_STATIC "Enable building static linked testzlib" ON)
-option(ZLIB_TESTZLIB_BUILD_TESTING "Enable building tests for testzlib" ON)
+option(ZLIB_TESTZLIB_INSTALL "Enable installation of testzlib" ON)
if(ZLIB_TESTZLIB_BUILD_SHARED)
- add_executable(testzlib testzlib.c)
- target_link_libraries(testzlib PRIVATE ZLIB::ZLIB)
+ add_executable(zlib_testzlib testzlib.c)
+ target_link_libraries(zlib_testzlib PRIVATE ZLIB::ZLIB)
+
+ set_target_properties(zlib_testzlib
+ PROPERTIES
+ OUTPUT_NAME testzlib)
+
+ if(ZLIB_TESTZLIB_INSTALL)
+ install(
+ TARGETS zlib_testzlib
+ COMPONENT Runtime
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
+ endif(ZLIB_TESTZLIB_INSTALL)
endif(ZLIB_TESTZLIB_BUILD_SHARED)
if(ZLIB_TESTZLIB_BUILD_STATIC)
- add_executable(testzlibStatic testzlib.c)
- target_link_libraries(testzlibStatic PRIVATE ZLIB::ZLIBSTATIC)
+ add_executable(zlib_testzlibStatic testzlib.c)
+ target_link_libraries(zlib_testzlibStatic PRIVATE ZLIB::ZLIBSTATIC)
+
+ set_target_properties(zlib_testzlibStatic
+ PROPERTIES
+ OUTPUT_NAME testzlibStatic)
+
+ if(ZLIB_TESTZLIB_INSTALL)
+ install(
+ TARGETS zlib_testzlibStatic
+ COMPONENT Runtime
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
+ endif(ZLIB_TESTZLIB_INSTALL)
endif(ZLIB_TESTZLIB_BUILD_STATIC)