project(klaptopdaemon)

include(AddFileDependencies)

check_include_files(stdint.h HAVE_STDINT_H)
configure_file(config-klaptopdaemon.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-klaptopdaemon.h )

add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/crcresult.h COMMAND ${CMAKE_CURRENT_BINARY_DIR}/makecrc  ARGS  > ${CMAKE_CURRENT_BINARY_DIR}/crcresult.h DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/makecrc  )


add_subdirectory( pics ) 
add_subdirectory( menus ) 



########### next target ###############

add_file_dependencies(${CMAKE_CURRENT_SOURCE_DIR}/acpi.cpp ${CMAKE_CURRENT_BINARY_DIR}/crcresult.h)

set(kcm_laptop_PART_SRCS
   ${CMAKE_CURRENT_BINARY_DIR}/crcresult.h
   battery.cpp 
   main.cpp 
   pcmcia.cpp 
   power.cpp 
   warning.cpp 
   acpi.cpp 
   sony.cpp 
   profile.cpp 
   buttons.cpp 
   apm.cpp )

kde4_add_plugin(kcm_laptop ${kcm_laptop_PART_SRCS})


target_link_libraries(kcm_laptop  ${KDE4_KDEUI_LIBS} kcmlaptop )

install(TARGETS kcm_laptop  DESTINATION ${PLUGIN_INSTALL_DIR})


########### next target ###############

#set(kded_klaptopdaemon_PART_SRCS $(MESSAGE_SOURCES) )

##kde4_add_dcop_skels(kded_klaptopdaemon_PART_SRCS laptop_daemon.h )

#kde4_add_plugin(kded_klaptopdaemon ${kded_klaptopdaemon_PART_SRCS})


#target_link_libraries(kded_klaptopdaemon  ${KDE4_KDEUI_LIBS} Xtst kcmlaptop )

#install(TARGETS kded_klaptopdaemon  DESTINATION ${PLUGIN_INSTALL_DIR})


########### next target ###############

set(klaptop_acpi_helper_SRCS acpi_helper.cpp )


kde4_add_executable(klaptop_acpi_helper ${klaptop_acpi_helper_SRCS})

target_link_libraries(klaptop_acpi_helper  ${KDE4_KDEUI_LIBS} )

install(TARGETS klaptop_acpi_helper  DESTINATION ${BIN_INSTALL_DIR} )


########### next target ###############

set(klaptop_check_SRCS laptop_check.cpp )

kde4_add_executable(klaptop_check ${klaptop_check_SRCS})

target_link_libraries(klaptop_check  ${KDE4_KDEUI_LIBS} kcmlaptop )

install(TARGETS klaptop_check  DESTINATION ${BIN_INSTALL_DIR} )


########### next target ###############

set(kcmlaptop_LIB_SRCS 
   portable.cpp 
   smapidev.c 
   daemon_state.cpp 
   wake_laptop.cpp 
   krichtextlabel.cpp )

kde4_add_library(kcmlaptop SHARED ${kcmlaptop_LIB_SRCS})

target_link_libraries(kcmlaptop  ${KDE4_KDE3SUPPORT_LIBS} )

set_target_properties(kcmlaptop PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION} )
install(TARGETS kcmlaptop  DESTINATION ${LIB_INSTALL_DIR})


########### next target ###############

set(makecrc_SRCS makecrc.cpp )


kde4_add_executable(makecrc ${makecrc_SRCS})

target_link_libraries(makecrc  ${KDE4_KDEUI_LIBS} )

