Skip to content

Commit

Permalink
added CPack
Browse files Browse the repository at this point in the history
  • Loading branch information
Vollstrecker committed Dec 26, 2024
1 parent 7ffd784 commit cc7a979
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 8 deletions.
30 changes: 27 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,21 @@ cmake_minimum_required(VERSION 3.10)

project(zlib
LANGUAGES C
VERSION 1.3.1.1)
VERSION 1.3.1.1
HOMEPAGE_URL "https://zlib.net/"
DESCRIPTION "a general-purpose lossless data-compression library")

#============================================================================
# CPack
#============================================================================
set(CPACK_PACKAGE_VENDOR "zlib-Project")
set(CPACK_PACKAGE_DESCRIPTION_FILE ${zlib_SOURCE_DIR}/README)
set(CPACK_RESOURCE_FILE_LICENSE ${zlib_SOURCE_DIR}/LICENSE)
set(CPACK_RESOURCE_FILE_README ${zlib_SOURCE_DIR}/README)

#============================================================================
# configuration
#============================================================================

option(ZLIB_BUILD_TESTING "Enable Zlib Examples as tests" ON)
option(ZLIB_BUILD_SHARED "Enable building zlib shared library" ON)
Expand All @@ -24,12 +38,12 @@ if(NOT DEFINED CMAKE_BUILD_TYPE AND NOT IS_MULTI)
message(STATUS "No CMAKE_BUILD_TYPE set -- using Release")
set(CMAKE_BUILD_TYPE Release)
endif(NOT DEFINED CMAKE_BUILD_TYPE AND NOT IS_MULTI)

include(CheckTypeSize)
include(CheckFunctionExists)
include(CheckIncludeFile)
include(CheckCSourceCompiles)
include(CMakePackageConfigHelpers)
include(CPack)
include(GNUInstallDirs)

if(NOT ZLIB_CONF_WRITTEN)
Expand Down Expand Up @@ -275,8 +289,18 @@ if(ZLIB_INSTALL_LIBRARIES)
COMPONENT Development
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
install(FILES zlib.3
COMPONENT Development
COMPONENT Docs
DESTINATION "${CMAKE_INSTALL_MANDIR}/man3")
install(FILES
LICENSE
doc/algorithm.txt
doc/crc-doc.1.0.pdf
doc/rfc1950.txt
doc/rfc1951.txt
doc/rfc1952.txt
doc/txtvsbin.txt
COMPONENT Docs
DESTINATION "${CMAKE_INSTALL_DOCDIR}/zlib")
install(FILES ${ZLIB_PC}
COMPONENT Development
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
Expand Down
23 changes: 18 additions & 5 deletions contrib/minizip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,26 @@ cmake_minimum_required(VERSION 3.12)

project(minizip
VERSION 1.0.0
LANGUAGES C)
LANGUAGES C
DESCRIPTION "A library for creating zipfiles based in zlib"
HOMEPAGE_URL "https://www.winimage.com/zLibDll/minizip.html")

if(CMAKE_SIZEOF_VOID_P LESS 8)
if(CMAKE_SIZEOF_VOID_P LESS 8 AND NOT MINGW)
message(WARNING "libminizip needs 64bit - stopping here")
return()
endif(CMAKE_SIZEOF_VOID_P LESS 8)

# return()
endif(CMAKE_SIZEOF_VOID_P LESS 8 AND NOT MINGW)

#============================================================================
# CPack
#============================================================================
set(CPACK_PACKAGE_VENDOR "zlib-Project")
set(CPACK_PACKAGE_DESCRIPTION_FILE ${minizip_SOURCE_DIR}/MiniZip64_info.txt)
set(CPACK_RESOURCE_FILE_LICENSE ${minizip_SOURCE_DIR}/../../LICENSE)
set(CPACK_RESOURCE_FILE_README ${minizip_SOURCE_DIR}/MiniZip64_info.txt)

#============================================================================
# configuration
#============================================================================
option(MINIZIP_BUILD_SHARED "Enable building zlib shared library" ON)
option(MINIZIP_BUILD_STATIC "Enable building zlib static library" ON)
option(MINIZIP_BUILD_TESTING "Enable testing of minizip" ON)
Expand Down

0 comments on commit cc7a979

Please sign in to comment.