-
Notifications
You must be signed in to change notification settings - Fork 460
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Linux: Enable native notifications with Qt 6
- Loading branch information
Showing
4 changed files
with
56 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,26 @@ | ||
OPTION(WITH_NATIVE_NOTIFICATIONS "Build with native notification support" ON) | ||
|
||
if (WITH_NATIVE_NOTIFICATIONS AND WITH_QT6) | ||
message(WARNING "Native notifications are not supported with Qt 6") | ||
elseif (WITH_NATIVE_NOTIFICATIONS) | ||
if (WITH_NATIVE_NOTIFICATIONS) | ||
set(KF5_MIN_VERSION "5.18.0") | ||
|
||
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE) | ||
list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) | ||
|
||
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Notifications) | ||
|
||
list(APPEND copyq_LIBRARIES KF5::Notifications) | ||
if (WITH_QT6) | ||
set(KF6_MIN_VERSION "5.248.0") | ||
find_package(KF6 ${KF6_MIN_VERSION} REQUIRED COMPONENTS Notifications StatusNotifierItem) | ||
list(APPEND copyq_LIBRARIES KF6::Notifications KF6::StatusNotifierItem) | ||
else() | ||
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Notifications) | ||
list(APPEND copyq_LIBRARIES KF5::Notifications) | ||
endif() | ||
|
||
list(APPEND copyq_SOURCES | ||
gui/notificationnative/notificationnative.cpp | ||
gui/notificationnative/notificationdaemonnative.cpp) | ||
|
||
list(APPEND copyq_DEFINITIONS WITH_NATIVE_NOTIFICATIONS) | ||
|
||
include(KDEInstallDirs) | ||
install(FILES knotifications5/copyq.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFYRCDIR}) | ||
endif() |