
add_subdirectory( icons )
add_subdirectory( pics )
add_subdirectory( symbols )
add_subdirectory( templates )
add_subdirectory( syntax )
add_subdirectory( complete )
add_subdirectory( help )
add_subdirectory( encodings )
add_subdirectory( test )


include_directories(
  ${CMAKE_BINARY_DIR}
  ${CMAKE_CURRENT_BINARY_DIR}
  ${CMAKE_CURRENT_SOURCE_DIR}
  ${TDE_INCLUDE_DIR}
  ${TQT_INCLUDE_DIRS}
)

link_directories(
  ${TQT_LIBRARY_DIRS}
  ${TDE_LIB_DIR}
)


#####

set( _target ${PROJECT_NAME} )

set( ${_target}_SRCS
    latexcmd.cpp
    latexcmddialog.cpp
    texdocdialog.cpp
    userhelp.cpp
    userhelpdialog.cpp
    floatdialog.cpp
    mathenvdialog.cpp
    tabulardialog.cpp
    postscriptdialog.cpp
    previewconfigwidget.cpp
    quickpreview.cpp
    includegraphicsdialog.cpp
    newfilewizard.cpp
    managetemplatesdialog.cpp
    templates.cpp
    usermenudialog.cpp
    kileconfigdialog.cpp
    tabbingdialog.cpp
    symbolview.cpp
    quickdocumentdialog.cpp
    kilefileselect.cpp
    kileapplication.cpp
    docpart.cpp
    kile.cpp
    main.cpp
    kileactions.cpp
    kilestdactions.cpp
    kileinfo.cpp
    kiledocumentinfo.cpp
    kileproject.cpp
    kileprojectdlgs.cpp
    kileprojectview.cpp
    kilelistselector.cpp
    kilelyxserver.cpp
    latexoutputfilter.cpp
    outputinfo.cpp
    latexoutputinfo.cpp
    outputfilter.cpp
    kilegrepdialog.cpp
    kiletool.cpp
    kilelauncher.cpp
    kiletoolmanager.cpp
    kilestdtools.cpp
    kilelogwidget.cpp
    kileoutputwidget.cpp
    kilekonsolewidget.cpp
    kilewizard.cpp
    kilestructurewidget.cpp
    codecompletion.cpp
    configcodecompletion.cpp
    kiletoolconfigwidget.cpp
    kileedit.cpp
    cleandialog.cpp
    kilehelp.cpp
    configstructure.cpp
    convert.cpp
    kiledocmanager.cpp
    kileviewmanager.cpp
    kileeventfilter.cpp
    kileerrorhandler.cpp
    configcheckerdlg.cpp
    configtester.cpp
    kilesidebar.cpp
    plaintolatexconverter.cpp
    kileuntitled.cpp
    kilestatsdlg.cpp
    kilestatswidget.cpp
    previewwidget.cpp
    kilejscript.cpp
    scriptsmanagementwidget.cpp
    editorkeysequencemanager.cpp
    kileversion.cpp
    kileabbrevview.cpp
    kileextensions.cpp
    kilemultitabbar.cpp

    helpconfigwidget.ui
    latexconfigwidget.ui
    generalconfigwidget.ui
    configcheckerwidget.ui
    toolconfigwidget.ui
    librarytoolconfigwidget.ui
    processtoolconfigwidget.ui
    quicktoolconfigwidget.ui
    latextoolconfigwidget.ui
    newtoolwizard.ui
    envconfigwidget.ui
    structureconfigwidget.ui
    symbolviewconfig.ui
    scriptingconfigwidget.ui
    graphicsconfigwidget.ui
    newdocumentwidget.ui

    kileappIface.skel

    kileconfig.kcfgc
)

add_custom_command( OUTPUT kilejscript.lut.h
  COMMAND ${PERL_EXECUTABLE} ARGS ${CMAKE_CURRENT_SOURCE_DIR}/create_hash_table
    ${CMAKE_CURRENT_SOURCE_DIR}/kilejscript.cpp > kilejscript.lut.h
  DEPENDS kilejscript.cpp
)
set_property( SOURCE kilejscript.cpp APPEND PROPERTY
  OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/kilejscript.lut.h
)

tde_add_executable( ${_target} AUTOMOC
  SOURCES
        ${${_target}_SRCS}
  LINK
     tdecore-shared
     tdehtml-shared
     tdeprint-shared
     tdetexteditor-shared
     katepartinterfaces-shared
     kjs-shared

  DESTINATION ${BIN_INSTALL_DIR}
)


##### other data

tde_create_translated_desktop( kile.desktop )

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

install(
  FILES kileui.rc docpartui.rc kilestdtools.rc tips
  DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}
)
