project(plasma-system-monitor)
include_directories(${CMAKE_CURRENT_SOURCE_DIR} )

# lib

set(lib_SRCS
    monitoricon.cpp
    applet.cpp
)
kde4_add_library(plasma_applet-system-monitor SHARED ${lib_SRCS})

target_link_libraries(plasma_applet-system-monitor ${KDE4_PLASMA_LIBS} ${KDE4_KDEUI_LIBS})

set_target_properties(plasma_applet-system-monitor PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION} )

# HDD Monitor

set(hdd_SRCS
    hdd.cpp
)
kde4_add_ui_files(hdd_SRCS hdd-config.ui)
kde4_add_plugin(plasma_applet_sm_hdd ${hdd_SRCS})
target_link_libraries(plasma_applet_sm_hdd ${KDE4_PLASMA_LIBS} ${KDE4_KDEUI_LIBS} plasma_applet-system-monitor)

# Temperature Monitor

set(temparature_SRCS
    temperature.cpp
)
kde4_add_ui_files(temparature_SRCS temperature-config.ui temperature-config-adv.ui)
kde4_add_plugin(plasma_applet_sm_temperature ${temparature_SRCS})
target_link_libraries(plasma_applet_sm_temperature ${KDE4_PLASMA_LIBS} ${KDE4_KDEUI_LIBS} plasma_applet-system-monitor)

# Network Monitor

set(net_SRCS
    net.cpp
)
kde4_add_ui_files(net_SRCS net-config.ui net-config-adv.ui)
kde4_add_plugin(plasma_applet_sm_net ${net_SRCS})
target_link_libraries(plasma_applet_sm_net ${KDE4_PLASMA_LIBS} ${KDE4_KDEUI_LIBS} plasma_applet-system-monitor)

# CPU Monitor

set(cpu_SRCS
    cpu.cpp
)
kde4_add_ui_files(cpu_SRCS cpu-config.ui cpu-config-adv.ui)
kde4_add_plugin(plasma_applet_sm_cpu ${cpu_SRCS})
target_link_libraries(plasma_applet_sm_cpu ${KDE4_PLASMA_LIBS} ${KDE4_KDEUI_LIBS} plasma_applet-system-monitor)

# Harware Info

set(hwinfo_SRCS
    hwinfo.cpp
)
kde4_add_plugin(plasma_applet_sm_hwinfo ${hwinfo_SRCS})
target_link_libraries(plasma_applet_sm_hwinfo ${KDE4_PLASMA_LIBS} ${KDE4_KDEUI_LIBS} plasma_applet-system-monitor)

# Ram Monitor

set(ram_SRCS
    ram.cpp
)
kde4_add_ui_files(ram_SRCS ram-config.ui ram-config-adv.ui)
kde4_add_plugin(plasma_applet_sm_ram ${ram_SRCS})
target_link_libraries(plasma_applet_sm_ram ${KDE4_PLASMA_LIBS} ${KDE4_KDEUI_LIBS} plasma_applet-system-monitor)

# Main applet

set(system-monitor_SRCS
    system-monitor.cpp
    monitorbutton.cpp
)
kde4_add_plugin(plasma_applet_system-monitor ${system-monitor_SRCS})
target_link_libraries(plasma_applet_system-monitor ${KDE4_PLASMA_LIBS} ${KDE4_KDEUI_LIBS} plasma_applet-system-monitor)

# Install
install(TARGETS
    plasma_applet-system-monitor
    ${INSTALL_TARGETS_DEFAULT_ARGS})
install(TARGETS
    plasma_applet_sm_hdd
    plasma_applet_sm_temperature
    plasma_applet_sm_hwinfo
    plasma_applet_sm_net
    plasma_applet_sm_cpu
    plasma_applet_sm_ram
    plasma_applet_system-monitor
    DESTINATION ${PLUGIN_INSTALL_DIR})
install(FILES
    plasma-applet-sm_hdd.desktop
    plasma-applet-sm_temperature.desktop
    plasma-applet-sm_hwinfo.desktop
    plasma-applet-sm_net.desktop
    plasma-applet-sm_cpu.desktop
    plasma-applet-sm_ram.desktop
    plasma-applet-system-monitor.desktop
    DESTINATION ${SERVICES_INSTALL_DIR})
install(FILES
    hdd_panel.svgz
    DESTINATION ${DATA_INSTALL_DIR}/desktoptheme/default/system-monitor/)
