diff options
author | Vollstrecker <werner@vollstreckernet.de> | 2024-12-26 18:21:26 +0100 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2025-01-31 20:01:41 -0800 |
commit | e573155946e71cd4fdfaaa3e3bd433d3cfe914b0 (patch) | |
tree | 3fece7b2eecbe636bd320eb95e326cd8590a0823 | |
parent | 09b21ebd334be6d060393032583a9055c0ee8b9e (diff) | |
download | zlib-e573155946e71cd4fdfaaa3e3bd433d3cfe914b0.tar.gz zlib-e573155946e71cd4fdfaaa3e3bd433d3cfe914b0.tar.bz2 zlib-e573155946e71cd4fdfaaa3e3bd433d3cfe914b0.zip |
CMake: Add CPack.
-rw-r--r-- | CMakeLists.txt | 30 | ||||
-rw-r--r-- | contrib/minizip/CMakeLists.txt | 24 |
2 files changed, 46 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index b9b5b92..9003fd5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -2,7 +2,21 @@ cmake_minimum_required(VERSION 3.10) | |||
2 | 2 | ||
3 | project(zlib | 3 | project(zlib |
4 | LANGUAGES C | 4 | LANGUAGES C |
5 | VERSION 1.3.1.1) | 5 | VERSION 1.3.1.1 |
6 | HOMEPAGE_URL "https://zlib.net/" | ||
7 | DESCRIPTION "a general-purpose lossless data-compression library") | ||
8 | |||
9 | #============================================================================ | ||
10 | # CPack | ||
11 | #============================================================================ | ||
12 | set(CPACK_PACKAGE_VENDOR "zlib-Project") | ||
13 | set(CPACK_PACKAGE_DESCRIPTION_FILE ${zlib_SOURCE_DIR}/README) | ||
14 | set(CPACK_RESOURCE_FILE_LICENSE ${zlib_SOURCE_DIR}/LICENSE) | ||
15 | set(CPACK_RESOURCE_FILE_README ${zlib_SOURCE_DIR}/README) | ||
16 | |||
17 | #============================================================================ | ||
18 | # configuration | ||
19 | #============================================================================ | ||
6 | 20 | ||
7 | option(ZLIB_BUILD_TESTING "Enable Zlib Examples as tests" ON) | 21 | option(ZLIB_BUILD_TESTING "Enable Zlib Examples as tests" ON) |
8 | option(ZLIB_BUILD_SHARED "Enable building zlib shared library" ON) | 22 | option(ZLIB_BUILD_SHARED "Enable building zlib shared library" ON) |
@@ -24,12 +38,12 @@ if(NOT DEFINED CMAKE_BUILD_TYPE AND NOT IS_MULTI) | |||
24 | message(STATUS "No CMAKE_BUILD_TYPE set -- using Release") | 38 | message(STATUS "No CMAKE_BUILD_TYPE set -- using Release") |
25 | set(CMAKE_BUILD_TYPE Release) | 39 | set(CMAKE_BUILD_TYPE Release) |
26 | endif(NOT DEFINED CMAKE_BUILD_TYPE AND NOT IS_MULTI) | 40 | endif(NOT DEFINED CMAKE_BUILD_TYPE AND NOT IS_MULTI) |
27 | |||
28 | include(CheckTypeSize) | 41 | include(CheckTypeSize) |
29 | include(CheckFunctionExists) | 42 | include(CheckFunctionExists) |
30 | include(CheckIncludeFile) | 43 | include(CheckIncludeFile) |
31 | include(CheckCSourceCompiles) | 44 | include(CheckCSourceCompiles) |
32 | include(CMakePackageConfigHelpers) | 45 | include(CMakePackageConfigHelpers) |
46 | include(CPack) | ||
33 | include(GNUInstallDirs) | 47 | include(GNUInstallDirs) |
34 | 48 | ||
35 | if(NOT ZLIB_CONF_WRITTEN) | 49 | if(NOT ZLIB_CONF_WRITTEN) |
@@ -275,8 +289,18 @@ if(ZLIB_INSTALL_LIBRARIES) | |||
275 | COMPONENT Development | 289 | COMPONENT Development |
276 | DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") | 290 | DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") |
277 | install(FILES zlib.3 | 291 | install(FILES zlib.3 |
278 | COMPONENT Development | 292 | COMPONENT Docs |
279 | DESTINATION "${CMAKE_INSTALL_MANDIR}/man3") | 293 | DESTINATION "${CMAKE_INSTALL_MANDIR}/man3") |
294 | install(FILES | ||
295 | LICENSE | ||
296 | doc/algorithm.txt | ||
297 | doc/crc-doc.1.0.pdf | ||
298 | doc/rfc1950.txt | ||
299 | doc/rfc1951.txt | ||
300 | doc/rfc1952.txt | ||
301 | doc/txtvsbin.txt | ||
302 | COMPONENT Docs | ||
303 | DESTINATION "${CMAKE_INSTALL_DOCDIR}/zlib") | ||
280 | install(FILES ${ZLIB_PC} | 304 | install(FILES ${ZLIB_PC} |
281 | COMPONENT Development | 305 | COMPONENT Development |
282 | DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") | 306 | DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") |
diff --git a/contrib/minizip/CMakeLists.txt b/contrib/minizip/CMakeLists.txt index 766efb9..39e0dcb 100644 --- a/contrib/minizip/CMakeLists.txt +++ b/contrib/minizip/CMakeLists.txt | |||
@@ -2,13 +2,26 @@ cmake_minimum_required(VERSION 3.12) | |||
2 | 2 | ||
3 | project(minizip | 3 | project(minizip |
4 | VERSION 1.0.0 | 4 | VERSION 1.0.0 |
5 | LANGUAGES C) | 5 | LANGUAGES C |
6 | DESCRIPTION "A library for creating zipfiles based in zlib" | ||
7 | HOMEPAGE_URL "https://www.winimage.com/zLibDll/minizip.html") | ||
6 | 8 | ||
7 | if(CMAKE_SIZEOF_VOID_P LESS 8) | 9 | if(CMAKE_SIZEOF_VOID_P LESS 8 AND NOT MINGW) |
8 | message(WARNING "libminizip needs 64bit - stopping here") | 10 | message(WARNING "libminizip needs 64bit - stopping here") |
9 | return() | 11 | # return() |
10 | endif(CMAKE_SIZEOF_VOID_P LESS 8) | 12 | endif(CMAKE_SIZEOF_VOID_P LESS 8 AND NOT MINGW) |
11 | 13 | ||
14 | #============================================================================ | ||
15 | # CPack | ||
16 | #============================================================================ | ||
17 | set(CPACK_PACKAGE_VENDOR "zlib-Project") | ||
18 | set(CPACK_PACKAGE_DESCRIPTION_FILE ${minizip_SOURCE_DIR}/MiniZip64_info.txt) | ||
19 | set(CPACK_RESOURCE_FILE_LICENSE ${minizip_SOURCE_DIR}/../../LICENSE) | ||
20 | set(CPACK_RESOURCE_FILE_README ${minizip_SOURCE_DIR}/MiniZip64_info.txt) | ||
21 | |||
22 | #============================================================================ | ||
23 | # configuration | ||
24 | #============================================================================ | ||
12 | option(MINIZIP_BUILD_SHARED "Enable building zlib shared library" ON) | 25 | option(MINIZIP_BUILD_SHARED "Enable building zlib shared library" ON) |
13 | option(MINIZIP_BUILD_STATIC "Enable building zlib static library" ON) | 26 | option(MINIZIP_BUILD_STATIC "Enable building zlib static library" ON) |
14 | option(MINIZIP_BUILD_TESTING "Enable testing of minizip" ON) | 27 | option(MINIZIP_BUILD_TESTING "Enable testing of minizip" ON) |
@@ -23,6 +36,7 @@ include(CheckFunctionExists) | |||
23 | include(CheckIncludeFile) | 36 | include(CheckIncludeFile) |
24 | include(CheckCSourceCompiles) | 37 | include(CheckCSourceCompiles) |
25 | include(CMakePackageConfigHelpers) | 38 | include(CMakePackageConfigHelpers) |
39 | include(CPack) | ||
26 | include(GNUInstallDirs) | 40 | include(GNUInstallDirs) |
27 | 41 | ||
28 | if(MINIZIP_ENABLE_BZIP2) | 42 | if(MINIZIP_ENABLE_BZIP2) |