project(plasma-applet-qonjugator)
cmake_minimum_required(VERSION 2.6)

add_definitions(-DQONJUGATOR_USE_KDE -DQONJUGATOR_APPLET)

### find the Qonjugator and KDE4 libraries and set some useful definitions
set(qonjugator_uninstall_rule_created TRUE) # don't let QonjugatorLib create its own uninstall rule, since KDE4 already creates one
find_package(QonjugatorLib REQUIRED)
find_package(KDE4 REQUIRED)
include(KDE4Defaults)

add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
include_directories(${KDE4_INCLUDES} ${QONJUGATOR_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/../qonjugatorgui)

### tell the user where we will install everything
message("Qonjugator Plasmoid")
message("   The plasmoid will be installed in ${PLUGIN_INSTALL_DIR}")
message("   The desktop file will be installed in ${SERVICES_INSTALL_DIR}")

### compile
set(qonjugatorapplet_SRCS
    qonjugatorapplet.cpp
    ../qonjugatorgui/configgeneralwidget.cpp
    ../qonjugatorgui/lineedit.cpp)
kde4_add_ui_files(qonjugatorapplet_SRCS
                  ../qonjugatorgui/configgeneralwidget.ui)

kde4_add_plugin(plasma_applet_qonjugator
                ${qonjugatorapplet_SRCS})
target_link_libraries(plasma_applet_qonjugator
                      ${KDE4_PLASMA_LIBS} ${KDE4_KDEUI_LIBS} ${QONJUGATOR_LIBRARIES})

### install
install(TARGETS plasma_applet_qonjugator
        DESTINATION ${PLUGIN_INSTALL_DIR})
install(FILES plasma-applet-qonjugator.desktop
        DESTINATION ${SERVICES_INSTALL_DIR})

### add translations
add_subdirectory(po)
