set(LIPSTICK_SRC
	src/homeapplication.cpp
	src/lipsticksettings.cpp
	src/lipstickqmltypes.cpp
	src/lipstickapi.cpp
	src/utilities/qobjectlistmodel.cpp
	src/utilities/closeeventeater.cpp
	src/components/launcheritem.cpp
	src/components/launchermodel.cpp
	src/components/launchermonitor.cpp
	src/components/launcherdbus.cpp
	src/compositor/lipstickcompositor.cpp
	src/compositor/lipstickcompositorwindow.cpp
	src/compositor/asteroidgesturesextension.cpp
	src/notifications/notificationmanager.cpp
	src/notifications/lipsticknotification.cpp
	src/notifications/categorydefinitionstore.cpp
	src/notifications/notificationlistmodel.cpp
	src/notifications/notificationpreviewpresenter.cpp
	src/notifications/batterynotifier.cpp
	src/notifications/diskspacenotifier.cpp
	src/notifications/thermalnotifier.cpp
	src/notifications/notificationfeedbackplayer.cpp
	src/screenlock/screenlock.cpp
	src/volume/volumecontrol.cpp
	src/volume/pulseaudiocontrol.cpp
	src/usbmodeselector.cpp
	src/bluetoothagent.cpp
	src/localemanager.cpp
	src/shutdownscreen.cpp
	src/screenshotservice.cpp
)

# D-Bus adaptors, previously generated by qdbusxml2cpp calls at qmake time
qt6_add_dbus_adaptor(LIPSTICK_SRC src/notifications/notificationmanager.xml
	notificationmanager.h NotificationManager notificationmanageradaptor NotificationManagerAdaptor)
qt6_add_dbus_adaptor(LIPSTICK_SRC src/screenlock/screenlock.xml
	screenlock.h ScreenLock screenlock/screenlockadaptor ScreenLockAdaptor)
qt6_add_dbus_adaptor(LIPSTICK_SRC src/screenshotservice.xml
	screenshotservice.h ScreenshotService screenshotserviceadaptor ScreenshotServiceAdaptor)
qt6_add_dbus_adaptor(LIPSTICK_SRC src/compositor/compositor.xml
	lipstickcompositor.h LipstickCompositor lipstickcompositoradaptor LipstickCompositorAdaptor)

add_library(lipstick STATIC ${LIPSTICK_SRC})

qt6_generate_wayland_protocol_server_sources(lipstick
	FILES ${CMAKE_CURRENT_SOURCE_DIR}/wayland-protocols/asteroid-gestures-unstable-v1.xml)

target_compile_definitions(lipstick PUBLIC
	QT_COMPOSITOR_QUICK
	VERSION="${PROJECT_VERSION}")

target_include_directories(lipstick PUBLIC
	src
	src/3rdparty
	src/components
	src/compositor
	src/notifications
	src/screenlock
	src/utilities
	src/volume
	${CMAKE_CURRENT_BINARY_DIR})

target_link_libraries(lipstick PUBLIC
	Qt6::Quick
	Qt6::Qml
	Qt6::DBus
	Qt6::Sql
	Qt6::Gui
	Qt6::WaylandCompositor
	Qt6::CorePrivate
	Qt6::GuiPrivate
	Qt6::QmlPrivate
	Qt6::QuickPrivate
	Qt6::WaylandCompositorPrivate
	Timed::Timed
	PkgConfig::mlite6
	PkgConfig::mce
	PkgConfig::mce-qt6
	PkgConfig::keepalive
	PkgConfig::dbus-1
	PkgConfig::dbus-glib-1
	${ngf-qt6_LIBRARIES}
	PkgConfig::libsystemd
	PkgConfig::dsme_dbus_if
	PkgConfig::thermalmanager_dbus_if
	PkgConfig::usb-moded-qt6)

add_subdirectory(tools/notificationtool)

install(FILES src/lipstick.conf
	DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/dbus-1/system.d)
file(GLOB NOTIFICATION_CATEGORY_FILES src/notificationcategories/*.conf)
install(FILES ${NOTIFICATION_CATEGORY_FILES}
	DESTINATION ${CMAKE_INSTALL_DATADIR}/lipstick/notificationcategories)
install(PROGRAMS tools/screenshottool/screenshottool
	DESTINATION ${CMAKE_INSTALL_BINDIR})
