@@ -14,13 +14,14 @@ 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 Qt5" OFF )
2122option (SKIP_KDE "Do not include features requiring KDE Frameworks (notifications, global shortcuts)" OFF )
2223
23- if (NOT PREFER_QT6 )
24+ if (NOT PREFER_QT5 )
2425 find_package (Qt5 COMPONENTS Widgets QUIET )
2526endif ()
2627if (Qt5_FOUND)
@@ -50,29 +51,31 @@ if (Qt5_FOUND)
5051 endif ()
5152 endif ()
5253else ()
53- find_package (Qt6 CONFIG REQUIRED COMPONENTS Widgets WebEngineWidgets)
54- message (STATUS "Using Qt6" )
54+ find_package (Qt5 CONFIG REQUIRED COMPONENTS Widgets WebEngineWidgets)
55+ message (STATUS "Using Qt5" )
56+ add_definitions ( -DQT5 )
5557
5658 if (NOT SKIP_KDE)
57- find_package (KF6Notifications QUIET )
58- if (KF6Notifications_FOUND )
59+ find_package (KF5Notifications QUIET )
60+ if (KF5Notifications_FOUND )
5961 add_definitions ( -DKNOTIFICATIONS )
6062 else ()
61- message (WARNING "KF6Notifications not found, notifications will not work" )
63+ message (WARNING "KF5Notifications not found, notifications will not work" )
6264 endif ()
6365
64- find_package (KF6XmlGui QUIET )
65- if (KF6XmlGui_FOUND)
66+ find_package (KF5XmlGui QUIET )
67+ find_package (KF5CoreAddons QUIET )
68+ if (KF5XmlGui_FOUND AND KF5CoreAddons_FOUND)
6669 add_definitions ( -DKXMLGUI )
6770 else ()
68- message (WARNING "KF6XmlGui not found, some UI elements and global shortcuts will not work" )
71+ message (WARNING "KF5XmlGui not found, some UI elements and global shortcuts will not work" )
6972 endif ()
7073
71- find_package (KF6GlobalAccel QUIET )
72- if (KF6GlobalAccel_FOUND )
74+ find_package (KF5GlobalAccel QUIET )
75+ if (KF5GlobalAccel_FOUND )
7376 add_definitions ( -DKGLOBALACCEL )
7477 else ()
75- message (WARNING "KF6GlobalAccel not found, global shortcuts will not work" )
78+ message (WARNING "KF5GlobalAccel not found, global shortcuts will not work" )
7679 endif ()
7780 endif ()
7881endif ()
@@ -115,19 +118,30 @@ add_executable(discord-screenaudio ${discord-screenaudio_SRC})
115118
116119target_link_libraries (discord-screenaudio Qt::Widgets Qt::WebEngineWidgets rohrkabel)
117120
118- if (KF5Notifications_FOUND OR KF6Notifications_FOUND )
121+ if (KF5Notifications_FOUND)
119122 target_link_libraries (discord-screenaudio KF5::Notifications)
120123 install (FILES assets/discord-screenaudio.notifyrc DESTINATION ${CMAKE_INSTALL_PREFIX} /share/knotifications5)
121124endif ()
122- if (KF5XmlGui_FOUND OR KF6XmlGui_FOUND )
125+ if (KF5XmlGui_FOUND)
123126 target_link_libraries (discord-screenaudio KF5::XmlGui)
124127endif ()
125- if (KF5GlobalAccel_FOUND OR KF6GlobalAccel_FOUND)
128+ if (KF5GlobalAccel_FOUND)
129+ target_link_libraries (discord-screenaudio KF5::GlobalAccel)
130+ endif ()
131+
132+ if (KF5Notifications_FOUND)
133+ target_link_libraries (discord-screenaudio KF5::Notifications)
134+ install (FILES assets/discord-screenaudio.notifyrc DESTINATION ${CMAKE_INSTALL_PREFIX} /share/knotifications5)
135+ endif ()
136+ if (KF5XmlGui_FOUND)
137+ target_link_libraries (discord-screenaudio KF5::XmlGui KF5::CoreAddons)
138+ endif ()
139+ if (KF5GlobalAccel_FOUND)
126140 target_link_libraries (discord-screenaudio KF5::GlobalAccel)
127141endif ()
128142
129143install (TARGETS discord-screenaudio DESTINATION bin)
130- install (FILES assets/de.shorsh.discord-screenaudio.png DESTINATION ${CMAKE_INSTALL_PREFIX} /share/icons/hicolor/256x256 /apps)
144+ install (FILES assets/de.shorsh.discord-screenaudio.png DESTINATION ${CMAKE_INSTALL_PREFIX} /share/icons/hicolor/255x255 /apps)
131145install (PROGRAMS assets/de.shorsh.discord-screenaudio.desktop DESTINATION ${CMAKE_INSTALL_PREFIX} /share/applications)
132146configure_file (assets/de.shorsh.discord-screenaudio.metainfo.xml.in de.shorsh.discord-screenaudio.metainfo.xml)
133147install (FILES ${CMAKE_BINARY_DIR} /de.shorsh.discord-screenaudio.metainfo.xml DESTINATION ${CMAKE_INSTALL_PREFIX} /share/metainfo)
0 commit comments