Use pkg-configs imported target to link against DBus
To use -ldbus, the value of ${DBus_LIBARARY_DIR} would also need to be
added to the linker search paths.
To get around this, simply use the imported target by pkgconfig.
[1] b8b30ba571
This commit is contained in:
parent
55fe336ee4
commit
e7fd4257bf
2 changed files with 2 additions and 5 deletions
|
@ -78,7 +78,7 @@ if(UNIX AND NOT APPLE)
|
|||
find_package(WaylandProtocols REQUIRED)
|
||||
pkg_check_modules(XkbCommon IMPORTED_TARGET xkbcommon)
|
||||
find_package(PkgConfig QUIET REQUIRED)
|
||||
pkg_check_modules(DBus REQUIRED dbus-1)
|
||||
pkg_check_modules(DBus REQUIRED IMPORTED_TARGET dbus-1)
|
||||
endif()
|
||||
|
||||
if (NOT WIN32)
|
||||
|
|
|
@ -20,10 +20,7 @@ target_sources(kdeconnect_sendnotifications PRIVATE windowsnotificationslistener
|
|||
target_link_libraries(kdeconnect_sendnotifications runtimeobject windowsapp)
|
||||
else()
|
||||
target_sources(kdeconnect_sendnotifications PRIVATE dbusnotificationslistener.cpp)
|
||||
target_link_libraries(kdeconnect_sendnotifications ${DBus_LIBRARIES})
|
||||
target_include_directories(kdeconnect_sendnotifications
|
||||
SYSTEM PRIVATE ${DBus_INCLUDE_DIRS}
|
||||
)
|
||||
target_link_libraries(kdeconnect_sendnotifications PkgConfig::DBus)
|
||||
endif()
|
||||
|
||||
# Config
|
||||
|
|
Loading…
Reference in a new issue