2023-02-13 17:10:55 +08:00
|
|
|
set(VERSION_MAJOR 1)
|
|
|
|
set(VERSION_MINOR 0)
|
|
|
|
set(VERSION_MICRO 0)
|
|
|
|
set(UKUI_NOTIFICATION_VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_MICRO})
|
2023-02-20 09:24:12 +08:00
|
|
|
set(settings_DIR notification-settings/)
|
2023-02-13 17:10:55 +08:00
|
|
|
find_package(KF5WindowSystem)
|
2023-02-03 18:01:06 +08:00
|
|
|
set(ukui-notification_LIB_SRCS
|
2023-02-13 17:10:55 +08:00
|
|
|
notification-client.cpp
|
|
|
|
notification-client.h
|
|
|
|
popup-notification.h
|
|
|
|
popup-notification.cpp
|
|
|
|
ukui-notification_global.h
|
|
|
|
notification-client-private.h
|
|
|
|
utils.h
|
2023-02-20 09:24:12 +08:00
|
|
|
utils.cpp
|
|
|
|
${settings_DIR}notification-settings-properties.h
|
|
|
|
${settings_DIR}notification-settings-info.h
|
|
|
|
${settings_DIR}notification-settings-info.cpp
|
|
|
|
${settings_DIR}notification-settings.h
|
|
|
|
${settings_DIR}notification-settings.cpp
|
|
|
|
${settings_DIR}notification-settings-private.h)
|
2023-02-13 17:10:55 +08:00
|
|
|
set(HEADERS
|
|
|
|
notification-client.h
|
|
|
|
popup-notification.h
|
|
|
|
ukui-notification_global.h
|
|
|
|
utils.h)
|
2023-02-06 17:03:12 +08:00
|
|
|
if(COMMAND qt_add_dbus_interface)
|
|
|
|
qt_add_dbus_interface(ukui-notification_LIB_SRCS ../dbus/org.freedesktop.Notifications.xml notifications_interface)
|
|
|
|
qt_add_dbus_adaptor(ukui-notification_LIB_SRCS ../dbus/org.ukui.NotificationClient.xml notification-client-private.h UkuiNotification::NotificationClientPrivate)
|
|
|
|
else()
|
|
|
|
qt5_add_dbus_interface(ukui-notification_LIB_SRCS ../dbus/org.freedesktop.Notifications.xml notifications_interface)
|
|
|
|
qt5_add_dbus_adaptor(ukui-notification_LIB_SRCS ../dbus/org.ukui.NotificationClient.xml notification-client-private.h UkuiNotification::NotificationClientPrivate)
|
|
|
|
endif()
|
2023-02-03 18:01:06 +08:00
|
|
|
add_library(ukui-notification SHARED ${ukui-notification_LIB_SRCS})
|
|
|
|
target_link_libraries(ukui-notification
|
|
|
|
PRIVATE
|
|
|
|
Qt${QT_VERSION_MAJOR}::Core
|
|
|
|
Qt${QT_VERSION_MAJOR}::DBus
|
|
|
|
Qt${QT_VERSION_MAJOR}::Gui
|
2023-02-13 17:10:55 +08:00
|
|
|
KF5::WindowSystem
|
2023-02-20 09:24:12 +08:00
|
|
|
ukui-search
|
2023-02-03 18:01:06 +08:00
|
|
|
)
|
2023-02-16 09:28:41 +08:00
|
|
|
|
2023-02-09 13:54:53 +08:00
|
|
|
include(CMakePackageConfigHelpers)
|
2023-02-16 09:28:41 +08:00
|
|
|
set(CMAKECONFIG_INSTALL_DIR "/usr/share/cmake/ukui-notification")
|
|
|
|
set(HEADERS_INSTALL_DIR /usr/include/ukui-notification)
|
|
|
|
set(PC_INSTALL_DIR "/usr/lib/pkgconfig")
|
|
|
|
|
|
|
|
target_include_directories(ukui-notification PUBLIC $<INSTALL_INTERFACE:${HEADERS_INSTALL_DIR}>)
|
2023-02-09 13:54:53 +08:00
|
|
|
configure_package_config_file(
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/ukui-notification-config.cmake.in"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/ukui-notification-config.cmake"
|
|
|
|
INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR})
|
2023-02-16 09:28:41 +08:00
|
|
|
write_basic_package_version_file(
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/ukui-notification-config-version.cmake
|
|
|
|
VERSION ${UKUI_NOTIFICATION_VERSION}
|
|
|
|
COMPATIBILITY SameMajorVersion
|
|
|
|
)
|
|
|
|
|
2023-02-09 13:54:53 +08:00
|
|
|
configure_package_config_file(
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/ukui-notification.pc.in"
|
2023-02-14 17:21:09 +08:00
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/ukui-notification.pc"
|
2023-02-13 17:10:55 +08:00
|
|
|
INSTALL_DESTINATION ${PC_INSTALL_DIR})
|
|
|
|
set_target_properties(ukui-notification PROPERTIES
|
|
|
|
VERSION ${UKUI_NOTIFICATION_VERSION}
|
2023-02-16 09:28:41 +08:00
|
|
|
SOVERSION ${VERSION_MAJOR}
|
2023-02-13 17:10:55 +08:00
|
|
|
OUTPUT_NAME ukui-notification
|
|
|
|
)
|
2023-02-16 09:28:41 +08:00
|
|
|
install(TARGETS ukui-notification
|
|
|
|
EXPORT ukui-notification
|
|
|
|
PUBLIC_HEADER DESTINATION ${HEADERS_INSTALL_DIR}
|
|
|
|
LIBRARY DESTINATION /usr/lib
|
|
|
|
)
|
|
|
|
install(EXPORT ukui-notification
|
|
|
|
FILE ukui-notification-targets.cmake
|
|
|
|
DESTINATION ${CMAKECONFIG_INSTALL_DIR})
|
|
|
|
|
|
|
|
install(FILES ${HEADERS} DESTINATION ${HEADERS_INSTALL_DIR})
|
2023-02-14 17:21:09 +08:00
|
|
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ukui-notification.pc DESTINATION ${PC_INSTALL_DIR})
|
2023-02-16 09:28:41 +08:00
|
|
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ukui-notification-config.cmake
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/ukui-notification-config-version.cmake
|
2023-02-20 09:24:12 +08:00
|
|
|
DESTINATION ${CMAKECONFIG_INSTALL_DIR})
|