CMake: add dist target, sysconfdir default, requirement for librepo

This commit is contained in:
Silvan Calarco 2021-03-13 10:53:53 +01:00
parent 82e1d7238e
commit 88492caec4
2 changed files with 11 additions and 0 deletions

View File

@ -4,6 +4,10 @@ cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
set(LOCALEDIR "${CMAKE_INSTALL_PREFIX}/share/locale")
if (NOT SYSCONF_INSTALL_DIR)
set(SYSCONF_INSTALL_DIR "/etc")
endif()
file (STRINGS "VERSION" VERSION)
add_subdirectory(src)
@ -14,3 +18,9 @@ install(
FILES distromatic.conf
DESTINATION ${SYSCONF_INSTALL_DIR}
)
set(CPACK_SOURCE_GENERATOR "TBZ2")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${VERSION}")
set(CPACK_SOURCE_IGNORE_FILES "/build/;/.git/")
include(CPack)
add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)

View File

@ -5,6 +5,7 @@ find_package(Threads REQUIRED)
pkg_check_modules(RPM REQUIRED rpm)
pkg_check_modules(SQLITE3 REQUIRED sqlite3)
pkg_check_modules(LIBUNWIND REQUIRED libunwind)
pkg_check_modules(LIBREPO REQUIRED librepo)
pkg_check_modules(LIBDW REQUIRED libdw)
pkg_check_modules(LIBXML2 REQUIRED libxml-2.0)
find_library(LIBIBERTY NAMES iberty)