cmake_minimum_required(VERSION 3.15)

configure_file(${CMAKE_CURRENT_LIST_DIR}/${PROJECT_NAME}.pc.in
               share/pkgconfig/${PROJECT_NAME}.pc @ONLY)
install(
  FILES ${CMAKE_CURRENT_BINARY_DIR}/share/pkgconfig/${PROJECT_NAME}.pc
  DESTINATION ${CMAKE_INSTALL_PREFIX}/share/pkgconfig
  COMPONENT core)

set(CPACK_GENERATOR "DEB")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "all")
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "${PROJECT_DESCRIPTION}")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "${PROJECT_MAINTAINER}")
set(CPACK_DEBIAN_PACKAGE_SECTION "devel")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "bash (>=4.3)")
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS ON)
set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS_POLICY ON)
set(CPACK_DEBHELPER_COMPAT "12")
set(CPACK_DEBHELPER_GENCONTROL ON)
set(CPACK_SYSTEM_NAME "linux-${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
set(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}")

include(CPack)
