add_subdirectory( indi  )
add_subdirectory( tools )
add_subdirectory( data  )
add_subdirectory( icons )

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

link_directories(
  ${TQT_LIBRARY_DIRS}
  ${TDE_LIB_DIR}
)

##### kstars (executable)

tde_add_executable( kstars AUTOMOC

  SOURCES
        addcatdialogui.ui addlinkdialogui.ui
        ccdpreviewui.ui contrastbrightnessgui.ui
        details_data.ui details_position.ui
        details_links.ui details_database.ui
        details_log.ui devmanager.ui
        fitsheaderdialog.ui focusdialogdlg.ui
        fovdialogui.ui histdialog.ui
        imagereductionui.ui imgsequencedlgui.ui
        indiconf.ui indihostconf.ui
        kswizardui.ui newfovui.ui
        opsadvancedui.ui opscatalogui.ui
        opscolorsui.ui opsguidesui.ui
        opssolarsystemui.ui statform.ui
        streamformui.ui telescopewizard.ui
        thumbnailpickerui.ui thumbnaileditorui.ui
        telescopepropui.ui
        addcatdialog.cpp addlinkdialog.cpp
        colorscheme.cpp conbridlg.cpp
        csegment.cpp deepskyobject.cpp
        detaildialog.cpp devicemanager.cpp
        dms.cpp dmsbox.cpp
        filesource.cpp finddialog.cpp
        fitshistogram.cpp ccdpreviewwg.cpp
        customcatalog.cpp fitsimage.cpp
        fitsprocess.cpp fitsviewer.cpp
        focusdialog.cpp fov.cpp
        fovdialog.cpp geolocation.cpp
        imagereductiondlg.cpp imagesequence.cpp
        imageviewer.cpp indidevice.cpp
        indidriver.cpp indielement.cpp
        indifitsconf.cpp indigroup.cpp
        indimenu.cpp indiproperty.cpp
        indistd.cpp infobox.cpp
        infoboxes.cpp jupitermoons.cpp
        ksasteroid.cpp kscomet.cpp
        ksfilereader.cpp ksmoon.cpp
        ksnewstuff.cpp ksnumbers.cpp
        ksplanet.cpp ksplanetbase.cpp
        kspluto.cpp kspopupmenu.cpp
        kssun.cpp kstars.cpp
        kstarsactions.cpp kstarsdata.cpp
        kstarsdatetime.cpp kstarsdcop.cpp
        kstarsinit.cpp kstarssplash.cpp
        ksutils.cpp kswizard.cpp
        locationdialog.cpp magnitudespinbox.cpp
        main.cpp mapcanvas.cpp
        objectnamelist.cpp opsadvanced.cpp
        opscatalog.cpp opscolors.cpp
        opsguides.cpp opssolarsystem.cpp
        planetcatalog.cpp simclock.cpp
        skymap.cpp skymapdraw.cpp
        skymapevents.cpp skyobject.cpp
        skyobjectname.cpp skypoint.cpp
        stardatasink.cpp starobject.cpp
        starpixmap.cpp streamwg.cpp
        telescopewizardprocess.cpp telescopeprop.cpp
        timebox.cpp timedialog.cpp
        timespinbox.cpp timestepbox.cpp
        timeunitbox.cpp timezonerule.cpp
        toggleaction.cpp thumbnailpicker.cpp
        thumbnaileditor.cpp draglistbox.cpp
        Options.kcfgc kstarsinterface.skel
        simclockinterface.skel
  LINK
     tdecore-shared
     tdeui-shared
     tdeio-shared
     tdeprint-shared
     tdenewstuff-shared
     tdeeduplot-shared
     tdeeduui-shared
     extdate-shared
     kstarstools-static
     lilxml-static
     indicom-static
     
  DEPENDENCIES
     kstarstools-static
     tdeeduplot-shared
     tdeeduui-shared
     extdate-shared
     lilxml-static
     indicom-static

  DESTINATION ${BIN_INSTALL_DIR}
)


##### icons

tde_install_icons( )


##### other data

install(
    FILES kstarsui.rc fitsviewer.rc
    DESTINATION ${DATA_INSTALL_DIR}/kstars/
)

tde_create_translated_desktop( kstars.desktop )

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

install(
    FILES kstarsrc
    DESTINATION ${CONFIG_INSTALL_DIR}
)

install(
    FILES kstarsinterface.h simclockinterface.h
    DESTINATION ${INCLUDE_INSTALL_DIR}
)
