CPack instructions to build Debian package

Co-authored-by: Hennadii Chernyshchyk <genaloner@gmail.com>
This commit is contained in:
Javier O. Cordero Pérez
2022-07-07 16:01:21 +03:00
committed by GitHub
co-authored by Hennadii Chernyshchyk
parent 94efd5fb61
commit 34777f2e91
+20 -1
View File
@@ -1,6 +1,10 @@
cmake_minimum_required(VERSION 3.1) cmake_minimum_required(VERSION 3.1)
project(qhotkey VERSION 1.5.0 LANGUAGES CXX) project(qhotkey
VERSION 1.5.0
DESCRIPTION "Global hotkey library for Qt software"
HOMEPAGE_URL "https://skycoder42.github.io/QHotkey/"
LANGUAGES CXX)
option(QHOTKEY_EXAMPLES "Build examples" OFF) option(QHOTKEY_EXAMPLES "Build examples" OFF)
option(QHOTKEY_INSTALL "Enable install rule" ON) option(QHOTKEY_INSTALL "Enable install rule" ON)
@@ -18,6 +22,21 @@ else()
find_package(Qt${QT_DEFAULT_MAJOR_VERSION} COMPONENTS Core Gui REQUIRED) find_package(Qt${QT_DEFAULT_MAJOR_VERSION} COMPONENTS Core Gui REQUIRED)
endif() endif()
# General settings
set(CPACK_PACKAGE_VENDOR "Skycoder42")
set(CPACK_PACKAGE_CONTACT "Shatur")
set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.md")
# CPACK: DEB Specific Settings
set(CPACK_DEBIAN_PACKAGE_NAME "libqhotkey")
set(CPACK_DEBIAN_PACKAGE_SECTION "Libraries")
# Set dependencies
if(QT_DEFAULT_MAJOR_VERSION EQUAL 6)
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libqt6x11extras6 (>= 6.2.0)")
else()
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libqt5x11extras5 (>= 5.15.2)")
endif()
include(CPack)
add_library(qhotkey QHotkey/qhotkey.cpp) add_library(qhotkey QHotkey/qhotkey.cpp)
add_library(QHotkey::QHotkey ALIAS qhotkey) add_library(QHotkey::QHotkey ALIAS qhotkey)
target_link_libraries(qhotkey PUBLIC Qt${QT_DEFAULT_MAJOR_VERSION}::Core Qt${QT_DEFAULT_MAJOR_VERSION}::Gui) target_link_libraries(qhotkey PUBLIC Qt${QT_DEFAULT_MAJOR_VERSION}::Core Qt${QT_DEFAULT_MAJOR_VERSION}::Gui)