From 1bd543b8dd83d78cf50686f4c7bc1f21f1a7e212 Mon Sep 17 00:00:00 2001 From: DawnMagnet Date: Fri, 18 Apr 2025 14:57:26 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=80=20(CMakeLists.txt):=20Configure=20?= =?UTF-8?q?CPack=20for=20building=20and=20packaging=20the=20reflectcpp=20l?= =?UTF-8?q?ibrary=20The=20commit=20adds=20CPack=20configuration=20to=20the?= =?UTF-8?q?=20CMakeLists.txt=20file,=20setting=20up=20package=20informatio?= =?UTF-8?q?n,=20description,=20and=20specifying=20the=20generators=20for?= =?UTF-8?q?=20TGZ,=20RPM,=20and=20DEB=20packages.=20This=20allows=20for=20?= =?UTF-8?q?easier=20distribution=20and=20installation=20of=20the=20reflect?= =?UTF-8?q?cpp=20library.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9fa3d277..c9c571e8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -343,3 +343,35 @@ if (PROJECT_IS_TOP_LEVEL) NAMESPACE reflectcpp:: ) endif () + + +# CPack configuration + +# Set general package information +set(CPACK_PACKAGE_NAME "reflectcpp") +set(CPACK_PACKAGE_VENDOR "Reflect C++ Team") +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Reflect C++ library") +set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) +set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) +set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) +set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) +set(CPACK_PACKAGE_CONTACT "maintainer@reflectcpp.org") +set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") +set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.md") + +# Configure generators +set(CPACK_GENERATOR "TGZ;RPM;DEB") + +# DEB specific configuration +set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) +set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT) +# Fix maintainer information - ensure both are set consistently +set(CPACK_PACKAGE_CONTACT "maintainer@reflectcpp.org") +set(CPACK_DEBIAN_PACKAGE_MAINTAINER "maintainer@reflectcpp.org") +set(CPACK_DEBIAN_PACKAGE_DEPENDS "") + +# RPM specific configuration +set(CPACK_RPM_PACKAGE_REQUIRES "") + +include(CPack) +