@@ -14,65 +14,69 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
1414set (CMAKE_AUTOMOC ON )
1515set (CMAKE_AUTORCC ON )
1616set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG" )
17+ set (CMAKE_EXPORT_COMPILE_COMMANDS ON )
1718string (TIMESTAMP TIMESTAMP %s)
1819# set(CMAKE_AUTOUIC ON)
1920
20- option (PREFER_QT6 "Prefer Qt6 over Qt5 " OFF )
21+ option (PREFER_QT5 "Prefer Qt5 over Qt6 " OFF )
2122option (SKIP_KDE "Do not include features requiring KDE Frameworks (notifications, global shortcuts)" OFF )
2223
23- if (NOT PREFER_QT6 )
24- find_package (Qt5 COMPONENTS Widgets QUIET )
24+ if (NOT PREFER_QT5 )
25+ find_package (Qt6 COMPONENTS Widgets QUIET )
2526endif ()
26- if (Qt5_FOUND )
27- find_package (Qt5 CONFIG REQUIRED COMPONENTS Widgets WebEngineWidgets)
28- message (STATUS "Using Qt5 " )
27+ if (Qt6_FOUND )
28+ find_package (Qt6 CONFIG REQUIRED COMPONENTS Widgets WebEngineWidgets)
29+ message (STATUS "Using Qt6 " )
2930
3031 if (NOT SKIP_KDE)
31- find_package (KF5Notifications QUIET )
32- if (KF5Notifications_FOUND )
32+ find_package (KF6Notifications QUIET )
33+ if (KF6Notifications_FOUND )
3334 add_definitions ( -DKNOTIFICATIONS )
3435 else ()
35- message (WARNING "KF5Notifications not found, notifications will not work" )
36+ message (WARNING "KF6Notifications not found, notifications will not work" )
3637 endif ()
3738
38- find_package (KF5XmlGui QUIET )
39- if (KF5XmlGui_FOUND)
39+ find_package (KF6XmlGui QUIET )
40+ if (KF6XmlGui_FOUND)
41+ find_package (KF6CoreAddons QUIET REQUIRED)
4042 add_definitions ( -DKXMLGUI )
4143 else ()
42- message (WARNING "KF5XmlGui not found, some UI elements and global shortcuts will not work" )
44+ message (WARNING "KF6XmlGui not found, some UI elements and global shortcuts will not work" )
4345 endif ()
4446
45- find_package (KF5GlobalAccel QUIET )
46- if (KF5GlobalAccel_FOUND )
47+ find_package (KF6GlobalAccel QUIET )
48+ if (KF6GlobalAccel_FOUND )
4749 add_definitions ( -DKGLOBALACCEL )
4850 else ()
49- message (WARNING "KF5GlobalAccel not found, global shortcuts will not work" )
51+ message (WARNING "KF6GlobalAccel not found, global shortcuts will not work" )
5052 endif ()
5153 endif ()
5254else ()
53- find_package (Qt6 CONFIG REQUIRED COMPONENTS Widgets WebEngineWidgets)
54- message (STATUS "Using Qt6" )
55+ find_package (Qt5 CONFIG REQUIRED COMPONENTS Widgets WebEngineWidgets)
56+ message (STATUS "Using Qt5" )
57+ add_definitions ( -DQT5 )
5558
5659 if (NOT SKIP_KDE)
57- find_package (KF6Notifications QUIET )
58- if (KF6Notifications_FOUND )
60+ find_package (KF5Notifications QUIET )
61+ if (KF5Notifications_FOUND )
5962 add_definitions ( -DKNOTIFICATIONS )
6063 else ()
61- message (WARNING "KF6Notifications not found, notifications will not work" )
64+ message (WARNING "KF5Notifications not found, notifications will not work" )
6265 endif ()
6366
64- find_package (KF6XmlGui QUIET )
65- if (KF6XmlGui_FOUND)
67+ find_package (KF5XmlGui QUIET )
68+ find_package (KF5CoreAddons QUIET )
69+ if (KF5XmlGui_FOUND AND KF5CoreAddons_FOUND)
6670 add_definitions ( -DKXMLGUI )
6771 else ()
68- message (WARNING "KF6XmlGui not found, some UI elements and global shortcuts will not work" )
72+ message (WARNING "KF5XmlGui not found, some UI elements and global shortcuts will not work" )
6973 endif ()
7074
71- find_package (KF6GlobalAccel QUIET )
72- if (KF6GlobalAccel_FOUND )
75+ find_package (KF5GlobalAccel QUIET )
76+ if (KF5GlobalAccel_FOUND )
7377 add_definitions ( -DKGLOBALACCEL )
7478 else ()
75- message (WARNING "KF6GlobalAccel not found, global shortcuts will not work" )
79+ message (WARNING "KF5GlobalAccel not found, global shortcuts will not work" )
7680 endif ()
7781 endif ()
7882endif ()
@@ -115,19 +119,30 @@ add_executable(discord-screenaudio ${discord-screenaudio_SRC})
115119
116120target_link_libraries (discord-screenaudio Qt::Widgets Qt::WebEngineWidgets rohrkabel)
117121
118- if (KF5Notifications_FOUND OR KF6Notifications_FOUND )
122+ if (KF5Notifications_FOUND)
119123 target_link_libraries (discord-screenaudio KF5::Notifications)
120124 install (FILES assets/discord-screenaudio.notifyrc DESTINATION ${CMAKE_INSTALL_PREFIX} /share/knotifications5)
121125endif ()
122- if (KF5XmlGui_FOUND OR KF6XmlGui_FOUND )
126+ if (KF5XmlGui_FOUND)
123127 target_link_libraries (discord-screenaudio KF5::XmlGui)
124128endif ()
125- if (KF5GlobalAccel_FOUND OR KF6GlobalAccel_FOUND )
129+ if (KF5GlobalAccel_FOUND)
126130 target_link_libraries (discord-screenaudio KF5::GlobalAccel)
127131endif ()
128132
133+ if (KF6Notifications_FOUND)
134+ target_link_libraries (discord-screenaudio KF6::Notifications)
135+ install (FILES assets/discord-screenaudio.notifyrc DESTINATION ${CMAKE_INSTALL_PREFIX} /share/knotifications6)
136+ endif ()
137+ if (KF6XmlGui_FOUND)
138+ target_link_libraries (discord-screenaudio KF6::XmlGui KF6::CoreAddons)
139+ endif ()
140+ if (KF6GlobalAccel_FOUND)
141+ target_link_libraries (discord-screenaudio KF6::GlobalAccel)
142+ endif ()
143+
129144install (TARGETS discord-screenaudio DESTINATION bin)
130- install (FILES assets/de.shorsh.discord-screenaudio.png DESTINATION ${CMAKE_INSTALL_PREFIX} /share/icons/hicolor/256x256 /apps)
145+ install (FILES assets/de.shorsh.discord-screenaudio.png DESTINATION ${CMAKE_INSTALL_PREFIX} /share/icons/hicolor/255x255 /apps)
131146install (PROGRAMS assets/de.shorsh.discord-screenaudio.desktop DESTINATION ${CMAKE_INSTALL_PREFIX} /share/applications)
132147configure_file (assets/de.shorsh.discord-screenaudio.metainfo.xml.in de.shorsh.discord-screenaudio.metainfo.xml)
133148install (FILES ${CMAKE_BINARY_DIR} /de.shorsh.discord-screenaudio.metainfo.xml DESTINATION ${CMAKE_INSTALL_PREFIX} /share/metainfo)
0 commit comments