From: Michael Wallner Date: Fri, 11 Dec 2020 18:58:30 +0000 (+0100) Subject: cpack X-Git-Tag: 1.1.0-beta1~66 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=45ea90bdab096a56aaf00e5ba314d6dac27d23a3;p=awesomized%2Flibmemcached cpack --- diff --git a/CMakeLists.txt b/CMakeLists.txt index ef29a411..d8217f08 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,8 @@ include(CMakeVersions.txt) project(libmemcached VERSION "${LIBMEMCACHED_VERSION}" - DESCRIPTION "libmemcached https://github.com/m6w6/libmemcached" + HOMEPAGE_URL "https://github.com/m6w6/libmemcached" + DESCRIPTION "libmemcached, a C/C++ memcached client library" ) set(CXX_STANDARD 11) @@ -16,6 +17,10 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON) include(CMakeConfig.txt) +if(BUILD_DOCS OR BUILD_DOCSONLY) + add_subdirectory(docs) +endif() + if(NOT BUILD_DOCSONLY) set(CLIENTS @@ -44,10 +49,7 @@ if(NOT BUILD_DOCSONLY) # keep last configure_file(${CONFIGURE_FILE_IN} ${CONFIGURE_FILE_OUT} @ONLY) -endif() - -if(BUILD_DOCS OR BUILD_DOCSONLY) - add_subdirectory(docs) + include(CPack.txt) endif() if(ENV{INVALID_CONFIGURATION}) diff --git a/CPack.txt b/CPack.txt new file mode 100644 index 00000000..fae9db37 --- /dev/null +++ b/CPack.txt @@ -0,0 +1,47 @@ +# options + +# DEBs +if(EXISTS /usr/bin/dpkg) + message(STATUS "Enabling Debian packages") + set(CPACK_BINARY_DEB ON) +endif() + +# BSDs +if(CMAKE_SYSTEM_NAME MATCHES BSD AND EXISTS CPackFreeBSD.txt) + message(STATUS "Enabling FreeBSD packages") + set(CPACK_BINARY_FREEBSD ON) + include(CPackFreeBSD.txt) +endif() + +# RPMs +if(EXISTS /usr/bin/dnf OR EXISTS /usr/bin/yum OR EXISTS /usr/bin/rpm-build) + message(STATUS "Enabling RPM packages") + set(CPACK_BINARY_RPM ON) +endif() + +# shell installer +set(CPACK_BINARY_STGZ ON) + +# binary archive +set(CPACK_BINARY_TBZ2 0) +set(CPACK_BINARY_TGZ ${UNIX}) +set(CPACK_BINARY_TXZ 0) +set(CPACK_BINARY_TZ 0) +set(CPACK_BINARY_ZIP ${WIN32}) + +# source archive +set(CPACK_SOURCE_TBZ2 0) +set(CPACK_SOURCE_TGZ ${UNIX}) +set(CPACK_SOURCE_TXZ 0) +set(CPACK_SOURCE_TZ 0) +set(CPACK_SOURCE_ZIP ${WIN32}) + +# project internals +set(CPACK_PACKAGE_VENDOR ${CMAKE_PROJECT_HOMEPAGE_URL}) +set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md") +set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME}/${CPACK_PACKAGE_VERSION}") +set(CPACK_PACKAGE_CHECKSUM SHA1) +set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE") +set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.md") + +include(CPack)