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)
include(CMakeConfig.txt)
+if(BUILD_DOCS OR BUILD_DOCSONLY)
+ add_subdirectory(docs)
+endif()
+
if(NOT BUILD_DOCSONLY)
set(CLIENTS
# 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})
--- /dev/null
+# 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)