From 8cdbfc606e634783b9d6a5e97d7f7f62d26af3ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rimas=20Misevi=C4=8Dius?= Date: Sun, 24 Sep 2023 17:25:01 +0300 Subject: [PATCH] Add initial CPack configuration to CMakeLists.txt More info: https://cmake.org/cmake/help/latest/guide/tutorial/Packaging%20an%20Installer.html --- CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ac1f887..5e9ba21 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -265,4 +265,14 @@ if (URL_INSTALL AND NOT URL_AMALGAMATED) FILE ${CMAKE_CURRENT_BINARY_DIR}/${upa_lib_name}-targets.cmake NAMESPACE upa:: ) + + # Packaging + if (URL_MAIN_PROJECT) + set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") + 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_SOURCE_GENERATOR "ZIP") + include(CPack) + endif() endif()