From b76b5847698394566897d02253fca10ba7499508 Mon Sep 17 00:00:00 2001 From: Buschmann Date: Mon, 7 Mar 2022 14:31:14 +0100 Subject: [PATCH] Do not link against libdbus, use macros for dbus version --- src/CMakeLists.txt | 12 +++++++----- src/hbnsclicensemodel.cpp | 7 +------ 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 55f3f14..a0588fe 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -18,7 +18,7 @@ if(HBNSC_WITH_SQLITE) endif(HBNSC_WITH_SQLITE) if(HBNSC_WITH_DBUS) - pkg_search_module(DBus dbus-1 REQUIRED IMPORTED_TARGET) + pkg_search_module(DBus dbus-1 REQUIRED) endif(HBNSC_WITH_DBUS) set(HBN_SFOS_Comps_SRCS @@ -50,7 +50,6 @@ target_link_libraries(HbnSfosComponentsQt${QT_VERSION_MAJOR} $<$:OpenSSL::SSL> $<$:PkgConfig::NemoNotify> $<$:SQLite::SQLite3> - $<$:PkgConfig::DBus> $<$:FirfuoridaQt${QT_VERSION_MAJOR}::Core> PkgConfig::Sailfish PkgConfig::Silica @@ -95,9 +94,12 @@ if(ENABLE_MAINTAINER_FLAGS) ) endif(ENABLE_MAINTAINER_FLAGS) -target_include_directories(HbnSfosComponentsQt${QT_VERSION_MAJOR} PUBLIC - "$" - "$" +target_include_directories(HbnSfosComponentsQt${QT_VERSION_MAJOR} + PUBLIC + "$" + "$" + PRIVATE + $<$:${DBus_INCLUDE_DIRS}> ) set_target_properties(HbnSfosComponentsQt${QT_VERSION_MAJOR} PROPERTIES diff --git a/src/hbnsclicensemodel.cpp b/src/hbnsclicensemodel.cpp index a075416..9f5ffe3 100644 --- a/src/hbnsclicensemodel.cpp +++ b/src/hbnsclicensemodel.cpp @@ -189,15 +189,10 @@ LicenseModel::LicenseModel(QObject *parent) : QAbstractListModel(parent) #endif #ifdef HBNSC_WITH_DBUS - int dbus_maj_ver = 0; - int dbus_min_ver = 0; - int dbus_mic_ver = 0; - dbus_get_version(&dbus_maj_ver, &dbus_min_ver, &dbus_mic_ver); - QVersionNumber dbusVersion(dbus_maj_ver, dbus_min_ver, dbus_mic_ver); m_items.emplace_back( QStringLiteral("libdbus-1"), QStringLiteral("D-Bus-Team"), - dbusVersion.toString(), + QStringLiteral(DBUS_VERSION_STRING), QUrl(QStringLiteral("http://freedesktop.org/wiki/Software/dbus")), QString(), QStringLiteral("GNU General Public License, Version 2"),