
add_subdirectory( Icons )

include_directories(
  ${CMAKE_BINARY_DIR}
  ${CMAKE_CURRENT_BINARY_DIR}
  ${CMAKE_CURRENT_SOURCE_DIR}
  ${CMAKE_SOURCE_DIR}/lib
  ${TDE_INCLUDE_DIR}
  ${TQT_INCLUDE_DIRS}
)

link_directories(
  ${TQT_LIBRARY_DIRS}
)


##### configuration (static) ####################

tde_add_library( configuration STATIC_PIC AUTOMOC
  SOURCES kpilotConfig.cc kpilotSettings.kcfgc
  LINK tdecore-shared tdeui-shared tdeio-shared
)


##### kpilot (executable) #######################

tde_add_executable( kpilot AUTOMOC
  SOURCES pilotDaemonDCOP.stub kpilotDCOP.skel loggerDCOP.skel kpilot.cc
    pilotComponent.cc logWidget.cc memoWidget.cc addressWidget.cc
    addressEditor.cc dbviewerWidget.cc dbFlagsEditor.cc dbFlagsEditor_base.ui
    dbRecordEditor.cc dbAppInfoEditor.cc datebookWidget.cc todoWidget.cc
    todoEditor.cc todoEditor_base.ui fileInstaller.cc fileInstallWidget.cc
    listItems.cc
  LINK tdecore-shared tdeui-shared tdeio-shared tdeutils-shared
    kpilot-shared configuration-static
  DESTINATION ${BIN_INSTALL_DIR}
)


##### kpilotDaemon (executable) #################

tde_add_executable( kpilotDaemon AUTOMOC
  SOURCES pilotDaemonDCOP.skel kpilotDCOP.stub loggerDCOP.stub loggerDCOP.skel
    pilotDaemon.cc logFile.cc hotSync.cc internalEditorAction.cc
    fileInstaller.cc
  LINK tdecore-shared tdeui-shared tdeio-shared kpilot-shared
    configuration-static
  DESTINATION ${BIN_INSTALL_DIR}
)


##### kcm_kpilot (kpart) ########################

tde_add_kpart( kcm_kpilot AUTOMOC
  SOURCES pilotDaemonDCOP.stub kpilotConfigDialog.cc
    kpilotConfigDialog_device.ui kpilotConfigDialog_sync.ui
    kpilotConfigDialog_startup.ui kpilotConfigDialog_viewers.ui
    kpilotConfigDialog_backup.ui conduitConfigDialog.cc kpilotProbeDialog.cc
    kpilotConfigWizard_address.kcfgc kpilotConfigWizard_notes.kcfgc
    kpilotConfigWizard_vcal.kcfgc kpilotConfigWizard_user.ui
    kpilotConfigWizard_app.ui kpilotConfigWizard.cc dbSelectionDialog.cc
    dbSelection_base.ui
  LINK tdecore-shared tdeui-shared tdeio-shared kpilot-shared
    configuration-static
  DESTINATION ${PLUGIN_INSTALL_DIR}
)


##### other data ################################

install( FILES kpilotui.rc
  DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}
)

install( FILES kpilot.desktop kpilotdaemon.desktop
  DESTINATION ${XDG_APPS_INSTALL_DIR}
)

install( FILES kpilot.upd
  DESTINATION ${DATA_INSTALL_DIR}/tdeconf_update
)

install( FILES kpilot_config.desktop
  DESTINATION ${SERVICES_INSTALL_DIR}
)

install( FILES kpilotconduit.desktop
  DESTINATION ${SERVICETYPES_INSTALL_DIR}
)

install( FILES kpilot.kcfg
  DESTINATION ${KCFG_INSTALL_DIR}
)
