From 9f7400d32229c0a1d32349cf0a61900a50f0437a Mon Sep 17 00:00:00 2001 From: Petr Hodina Date: Sun, 29 May 2022 06:09:27 +0200 Subject: [PATCH] Remove systemd. diff --git a/CMakeLists.txt b/CMakeLists.txt index be4e836..97f5aef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,27 +12,6 @@ include(GNUInstallDirs) # Installation directories for `install` command and pkg # PERFORMING CHECKS & PREPARING THE DEPENDENCIES #------------------------------- -option(BUILD_LIBSYSTEMD "Build libsystemd static library and incorporate it into libsdbus-c++" OFF) - -if(NOT BUILD_LIBSYSTEMD) - find_package(PkgConfig REQUIRED) - pkg_check_modules(Systemd IMPORTED_TARGET GLOBAL libsystemd>=236) - if(NOT TARGET PkgConfig::Systemd) - message(FATAL_ERROR "libsystemd of version at least 236 is required, but was not found " - "(if you have systemd in your OS, you may want to install package containing pkgconfig " - " files for libsystemd library. On Ubuntu, that is libsystemd-dev. " - " Alternatively, you may turn BUILD_LIBSYSTEMD on for sdbus-c++ to download, build " - "and incorporate libsystemd as embedded library within sdbus-c++)") - endif() - add_library(Systemd::Libsystemd ALIAS PkgConfig::Systemd) - string(REGEX MATCHALL "([0-9]+)" SYSTEMD_VERSION_LIST "${Systemd_VERSION}") - list(GET SYSTEMD_VERSION_LIST 0 LIBSYSTEMD_VERSION) - message(STATUS "Building with libsystemd v${LIBSYSTEMD_VERSION}") -else() - # Build static libsystemd library as an external project - include(cmake/LibsystemdExternalProject.cmake) -endif() - find_package(Threads REQUIRED) #------------------------------- @@ -104,18 +83,13 @@ endif() # Having an object target allows unit tests to reuse already built sources without re-building add_library(sdbus-c++-objlib OBJECT ${SDBUSCPP_SRCS}) -target_compile_definitions(sdbus-c++-objlib PRIVATE BUILD_LIB=1 LIBSYSTEMD_VERSION=${LIBSYSTEMD_VERSION}) target_include_directories(sdbus-c++-objlib PUBLIC $ $) if(DEFINED BUILD_SHARED_LIBS) set_target_properties(sdbus-c++-objlib PROPERTIES POSITION_INDEPENDENT_CODE ${BUILD_SHARED_LIBS}) endif() -if(BUILD_LIBSYSTEMD) - add_dependencies(sdbus-c++-objlib LibsystemdBuildProject) -endif() target_link_libraries(sdbus-c++-objlib PUBLIC - Systemd::Libsystemd Threads::Threads) add_library(sdbus-c++) @@ -231,6 +205,5 @@ set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT) set(CPACK_DEBIAN_PACKAGE_SECTION "libs") set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) set(CPACK_DEBIAN_ENABLE_COMPONENT_DEPENDS ON) -set(CPACK_DEBIAN_DEV_PACKAGE_DEPENDS "libsystemd-dev (>=236)") include(CPack) -- 2.35.1