project(plasma-logout)

find_package(KDE4 REQUIRED)

add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES})

set(logout_SRCS
    logout.cpp)

set(ksmserver_xml ${KDEBASE_WORKSPACE_SOURCE_DIR}/ksmserver/org.kde.KSMServerInterface.xml)
QT4_ADD_DBUS_INTERFACE(lockout_SRCS ${ksmserver_xml} ksmserver_interface)

kde4_add_plugin(plasma_applet_logout ${logout_SRCS})
target_link_libraries(plasma_applet_logout ${KDE4_PLASMA_LIBS} ${KDE4_KIO_LIBS})
if(NOT WIN32)
target_link_libraries(plasma_applet_logout kworkspace)
endif(NOT WIN32)

install(TARGETS plasma_applet_logout DESTINATION ${PLUGIN_INSTALL_DIR})
install(FILES plasma-applet-logout.desktop DESTINATION ${SERVICES_INSTALL_DIR})
