Skip to content
This repository was archived by the owner on Jun 21, 2024. It is now read-only.

Commit f50c547

Browse files
committed
CMakeLists.txt: Fix QT6 KDE framework build
1 parent 3f3f179 commit f50c547

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

CMakeLists.txt

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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

116121
target_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)
121126
endif()
122-
if(KF5XmlGui_FOUND OR KF6XmlGui_FOUND)
127+
if(KF5XmlGui_FOUND)
123128
target_link_libraries(discord-screenaudio KF5::XmlGui)
124129
endif()
125-
if(KF5GlobalAccel_FOUND OR KF6GlobalAccel_FOUND)
130+
if(KF5GlobalAccel_FOUND)
126131
target_link_libraries(discord-screenaudio KF5::GlobalAccel)
127132
endif()
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+
129146
install(TARGETS discord-screenaudio DESTINATION bin)
130147
install(FILES assets/de.shorsh.discord-screenaudio.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/256x256/apps)
131148
install(PROGRAMS assets/de.shorsh.discord-screenaudio.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications)

0 commit comments

Comments
 (0)