2020-06-18 13:55:52 +02:00
|
|
|
find_package(ZLIB REQUIRED)
|
|
|
|
find_package(PkgConfig)
|
|
|
|
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
pkg_check_modules(RPM REQUIRED rpm)
|
|
|
|
pkg_check_modules(SQLITE3 REQUIRED sqlite3)
|
2021-02-14 14:28:21 +01:00
|
|
|
pkg_check_modules(LIBUNWIND REQUIRED libunwind)
|
2021-03-13 10:53:53 +01:00
|
|
|
pkg_check_modules(LIBREPO REQUIRED librepo)
|
2021-02-14 14:28:21 +01:00
|
|
|
pkg_check_modules(LIBDW REQUIRED libdw)
|
2021-02-14 22:02:35 +01:00
|
|
|
pkg_check_modules(LIBXML2 REQUIRED libxml-2.0)
|
2024-05-16 10:16:09 +02:00
|
|
|
pkg_check_modules(LIBZCK REQUIRED zck)
|
2020-06-18 13:55:52 +02:00
|
|
|
find_library(LIBIBERTY NAMES iberty)
|
|
|
|
|
|
|
|
include_directories(include)
|
|
|
|
|
|
|
|
string(REPLACE "." ";" VERSION_LIST ${RPM_VERSION})
|
|
|
|
list(GET VERSION_LIST 0 RPM_VERSION_MAJOR)
|
|
|
|
list(GET VERSION_LIST 1 RPM_VERSION_MINOR)
|
|
|
|
list(GET VERSION_LIST 2 RPM_VERSION_MICRO)
|
|
|
|
|
|
|
|
add_compile_definitions(
|
2020-06-27 16:30:53 +02:00
|
|
|
PACKAGE="distromatic"
|
|
|
|
PACKAGE_NAME="Distromatic"
|
2021-03-14 19:32:24 +01:00
|
|
|
PACKAGE_VERSION="${VERSION}"
|
2020-06-18 13:55:52 +02:00
|
|
|
DEFAULT_CONFIGFILE="/etc/distromatic.conf"
|
|
|
|
off64_t=__off64_t
|
|
|
|
RPM_VERSION_MAJOR=${RPM_VERSION_MAJOR}
|
|
|
|
RPM_VERSION_MINOR=${RPM_VERSION_MINOR}
|
|
|
|
RPM_VERSION_MICRO=${RPM_VERSION_MICRO}
|
|
|
|
LOCALEDIR="${LOCALEDIR}"
|
|
|
|
)
|
|
|
|
|
|
|
|
add_executable(distromatic
|
|
|
|
buildtools.c
|
|
|
|
changelog.c
|
|
|
|
distromatic.c
|
|
|
|
functions.c
|
|
|
|
reports.c
|
|
|
|
headerlist.c
|
|
|
|
requirelist.c
|
|
|
|
rpmfunctions.c
|
|
|
|
backend-sqlite3.c
|
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries(distromatic
|
|
|
|
Threads::Threads
|
|
|
|
${RPM_LIBRARIES}
|
|
|
|
${ZLIB_LIBRARIES}
|
|
|
|
${SQLITE3_LIBRARIES}
|
2021-02-14 22:02:35 +01:00
|
|
|
${LIBREPO_LIBRARIES}
|
|
|
|
${LIBXML2_LIBRARIES}
|
2021-02-14 14:28:21 +01:00
|
|
|
${LIBUNWIND_LIBRARIES}
|
|
|
|
${LIBDW_LIBRARIES}
|
2020-06-18 13:55:52 +02:00
|
|
|
${LIBIBERTY}
|
|
|
|
)
|
2021-02-14 22:02:35 +01:00
|
|
|
target_include_directories(distromatic PUBLIC
|
|
|
|
${RPM_INCLUDE_DIRS}
|
|
|
|
${LIBREPO_INCLUDE_DIRS}
|
|
|
|
${LIBXML2_INCLUDE_DIRS}
|
|
|
|
${LIBUNWIND_INCLUDE_DIRS}
|
|
|
|
)
|
|
|
|
|
2020-06-20 14:37:50 +02:00
|
|
|
#
|
|
|
|
# NOTE: -fno-toplevel-reorder required to prevent Sqlite3 weird problems
|
|
|
|
#
|
2021-02-16 20:24:29 +01:00
|
|
|
target_compile_options(distromatic PUBLIC -O2 -g -Wall -std=gnu11 -pedantic ${RPM_CFLAGS_OTHER})
|
|
|
|
# -fno-toplevel-reorder
|
2024-05-30 12:16:48 +02:00
|
|
|
|
2020-06-18 13:55:52 +02:00
|
|
|
add_executable(distroquery
|
2024-05-30 12:16:48 +02:00
|
|
|
distroquery.cpp
|
2020-06-18 13:55:52 +02:00
|
|
|
functions.c
|
|
|
|
headerlist.c
|
|
|
|
requirelist.c
|
|
|
|
rpmfunctions.c
|
|
|
|
changelog.c
|
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries(distroquery
|
|
|
|
Threads::Threads
|
|
|
|
${RPM_LIBRARIES}
|
|
|
|
${ZLIB_LIBRARIES}
|
|
|
|
${SQLITE3_LIBRARIES}
|
2021-02-14 22:02:35 +01:00
|
|
|
${LIBREPO_LIBRARIES}
|
|
|
|
${LIBXML2_LIBRARIES}
|
2021-02-14 14:28:21 +01:00
|
|
|
${LIBUNWIND_LIBRARIES}
|
|
|
|
${LIBDW_LIBRARIES}
|
2020-06-18 13:55:52 +02:00
|
|
|
${LIBIBERTY}
|
|
|
|
)
|
2024-05-30 12:16:48 +02:00
|
|
|
|
2021-02-14 22:02:35 +01:00
|
|
|
target_include_directories(distroquery PUBLIC
|
|
|
|
${RPM_INCLUDE_DIRS}
|
|
|
|
${LIBREPO_INCLUDE_DIRS}
|
|
|
|
${LIBXML2_INCLUDE_DIRS}
|
|
|
|
${LIBUNWIND_INCLUDE_DIRS}
|
|
|
|
)
|
2020-06-18 15:14:52 +02:00
|
|
|
|
|
|
|
install(
|
|
|
|
TARGETS distromatic
|
|
|
|
DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
|
|
|
|
)
|
|
|
|
|
|
|
|
install(
|
|
|
|
TARGETS distroquery
|
|
|
|
DESTINATION /var/www/cgi-bin/
|
|
|
|
)
|