Skip to content

Commit

Permalink
Do not link against libdbus, use macros for dbus version
Browse files Browse the repository at this point in the history
  • Loading branch information
buschmann23 committed Mar 7, 2022
1 parent 5f85805 commit b76b584
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
12 changes: 7 additions & 5 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -50,7 +50,6 @@ target_link_libraries(HbnSfosComponentsQt${QT_VERSION_MAJOR}
$<$<BOOL:${HBNSC_WITH_OPENSSL}>:OpenSSL::SSL>
$<$<BOOL:${HBNSC_WITH_NEMONOTIFY}>:PkgConfig::NemoNotify>
$<$<BOOL:${HBNSC_WITH_SQLITE}>:SQLite::SQLite3>
$<$<BOOL:${HBNSC_WITH_DBUS}>:PkgConfig::DBus>
$<$<BOOL:${HBNSC_WITH_FIRFUORIDA}>:FirfuoridaQt${QT_VERSION_MAJOR}::Core>
PkgConfig::Sailfish
PkgConfig::Silica
Expand Down Expand Up @@ -95,9 +94,12 @@ if(ENABLE_MAINTAINER_FLAGS)
)
endif(ENABLE_MAINTAINER_FLAGS)

target_include_directories(HbnSfosComponentsQt${QT_VERSION_MAJOR} PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/HbnSfosComponents-qt${QT_VERSION_MAJOR}>"
target_include_directories(HbnSfosComponentsQt${QT_VERSION_MAJOR}
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/HbnSfosComponents-qt${QT_VERSION_MAJOR}>"
PRIVATE
$<$<BOOL:${HBNSC_WITH_DBUS}>:${DBus_INCLUDE_DIRS}>
)

set_target_properties(HbnSfosComponentsQt${QT_VERSION_MAJOR} PROPERTIES
Expand Down
7 changes: 1 addition & 6 deletions src/hbnsclicensemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down

0 comments on commit b76b584

Please sign in to comment.