@@ -63,7 +63,12 @@ else()
6363
6464 find_package (KF6XmlGui QUIET )
6565 if (KF6XmlGui_FOUND)
66- add_definitions ( -DKXMLGUI )
66+ find_package (KF6CoreAddons QUIET )
67+ if (KF6CoreAddons_FOUND)
68+ add_definitions ( -DKXMLGUI )
69+ else ()
70+ message (WARNING "KF6XmlGui found, but its required dependency KF6KCoreAddons was not found, skipping it" )
71+ endif ()
6772 else ()
6873 message (WARNING "KF6XmlGui not found, some UI elements and global shortcuts will not work" )
6974 endif ()
@@ -115,17 +120,29 @@ add_executable(discord-screenaudio ${discord-screenaudio_SRC})
115120
116121target_link_libraries (discord-screenaudio Qt::Widgets Qt::WebEngineWidgets rohrkabel)
117122
118- if (KF5Notifications_FOUND OR KF6Notifications_FOUND )
123+ if (KF5Notifications_FOUND)
119124 target_link_libraries (discord-screenaudio KF5::Notifications)
120125 install (FILES assets/discord-screenaudio.notifyrc DESTINATION ${CMAKE_INSTALL_PREFIX} /share/knotifications5)
121126endif ()
122- if (KF5XmlGui_FOUND OR KF6XmlGui_FOUND )
127+ if (KF5XmlGui_FOUND)
123128 target_link_libraries (discord-screenaudio KF5::XmlGui)
124129endif ()
125- if (KF5GlobalAccel_FOUND OR KF6GlobalAccel_FOUND )
130+ if (KF5GlobalAccel_FOUND)
126131 target_link_libraries (discord-screenaudio KF5::GlobalAccel)
127132endif ()
128133
134+ if (KF6Notifications_FOUND)
135+ target_link_libraries (discord-screenaudio KF6::Notifications)
136+ install (FILES assets/discord-screenaudio.notifyrc DESTINATION ${CMAKE_INSTALL_PREFIX} /share/knotifications5)
137+ endif ()
138+ if (KF6CoreAddons_FOUND AND KF6XmlGui_FOUND)
139+ target_link_libraries (discord-screenaudio KF6::CoreAddons)
140+ target_link_libraries (discord-screenaudio KF6::XmlGui)
141+ endif ()
142+ if (KF6GlobalAccel_FOUND)
143+ target_link_libraries (discord-screenaudio KF6::GlobalAccel)
144+ endif ()
145+
129146install (TARGETS discord-screenaudio DESTINATION bin)
130147install (FILES assets/de.shorsh.discord-screenaudio.png DESTINATION ${CMAKE_INSTALL_PREFIX} /share/icons/hicolor/256x256/apps)
131148install (PROGRAMS assets/de.shorsh.discord-screenaudio.desktop DESTINATION ${CMAKE_INSTALL_PREFIX} /share/applications)
0 commit comments