#################################################
#
#  (C) 2016 Slávek Banko
#  slavek (DOT) banko (AT) axis.cz
#
#  Improvements and feedback are welcome
#
#  This file is released under GPL >= 2
#
#################################################

include_directories(
  ${CMAKE_BINARY_DIR}
  ${CMAKE_CURRENT_BINARY_DIR}
  ${CMAKE_CURRENT_BINARY_DIR}/core
  ${CMAKE_CURRENT_SOURCE_DIR}
  ${CMAKE_CURRENT_SOURCE_DIR}/core
  ${LIBXML_INCLUDE_DIRS}
  ${LIBXSLT_INCLUDE_DIRS}
  ${EXEMPI_INCLUDE_DIRS}
  ${TDE_INCLUDE_DIR}
  ${TQT_INCLUDE_DIRS}
)

link_directories(
  ${TQT_LIBRARY_DIRS}
  ${POPPLER_LIBRARY_DIRS}
)


##### tellico (executable) ######################

tde_add_executable( tellico AUTOMOC
  SOURCES
    borrower.cpp borrowerdialog.cpp
    borroweritem.cpp calendarhandler.cpp collection.cpp collectionfactory.cpp
    collectionfieldsdialog.cpp configdialog.cpp controller.cpp detailedentryitem.cpp
    detailedlistview.cpp document.cpp entry.cpp entryeditdialog.cpp entrygroupitem.cpp
    entryiconfactory.cpp entryiconview.cpp entryitem.cpp entrymerger.cpp entryupdater.cpp
    entryview.cpp exportdialog.cpp fetchdialog.cpp fetcherconfigdialog.cpp field.cpp
    fieldcompletion.cpp filehandler.cpp filter.cpp filterdialog.cpp filteritem.cpp
    filterview.cpp groupiterator.cpp groupview.cpp image.cpp imagefactory.cpp
    importdialog.cpp isbnvalidator.cpp iso5426converter.cpp iso6937converter.cpp
    listviewcomparison.cpp loandialog.cpp loanitem.cpp loanview.cpp main.cpp mainwindow.cpp
    progressmanager.cpp reportdialog.cpp statusbar.cpp tellico_kernel.cpp tellico_strings.cpp
    tellico_utils.cpp upcvalidator.cpp viewstack.cpp xmphandler.cpp lccnvalidator.cpp
  LINK
    core-static gui-static cite-static fetch-static
    collections-static newstuff-static translators-static
    pilotdb-static pilotdb_flatfile-static pilotdb_palm-static
    rtf2html-static commands-static ${BTPARSE_LIBRARIES} ${WEBCAM_LIBRARIES}
    tdecore-shared tdefx-shared tdeui-shared tdeio-shared tdehtml-shared
    tdetexteditor-shared tdeparts-shared tdenewstuff-shared tdeabc-shared
    ${LIBKCAL_LIBRARY} ${LIBKCDDB_LIBRARY} ${LIBXML_LIBRARIES} ${LIBXSLT_LIBRARIES}
    ${TAGLIB_LIBRARIES} ${YAZ_LIBRARIES} ${EXEMPI_LIBRARIES} ${POPPLER_LIBRARIES}
  DESTINATION ${BIN_INSTALL_DIR}
)


##### other data ################################
install(
  FILES tellicoui.rc
  DESTINATION ${DATA_INSTALL_DIR}/${CMAKE_PROJECT_NAME}
)
install(
  FILES tellicorc
  DESTINATION ${CONFIG_INSTALL_DIR}
)


##### directories ###############################

add_subdirectory( core )
add_subdirectory( gui )
add_subdirectory( collections )
add_subdirectory( translators )
add_subdirectory( fetch )
add_subdirectory( commands )
add_subdirectory( cite )
add_subdirectory( newstuff )
add_subdirectory( rtf2html )
tde_conditional_add_subdirectory( BUILD_WEBCAM_SUPPORT barcode )
add_subdirectory( tests )
