set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${KDE4_ENABLE_EXCEPTIONS}" )

#add_subdirectory( tests )

set( templateparser_LIB_SRCS

   customtemplates.cpp
   customtemplatesmenu.cpp
   templatesconfiguration.cpp
   templatesinsertcommand.cpp

   templateparser.cpp
)

include_directories(
    ${Boost_INCLUDE_DIR}
    ${CMAKE_SOURCE_DIR}/libkleo
    ${CMAKE_SOURCE_DIR}/messagecore
)

kde4_add_kcfg_files(templateparser_LIB_SRCS
  templatesconfiguration_kfg.kcfgc
  customtemplates_kfg.kcfgc
  globalsettings_base.kcfgc 
)

kde4_add_ui_files(templateparser_LIB_SRCS
  ui/templatesconfiguration_base.ui
  ui/customtemplates_base.ui
)


kde4_add_library( templateparser SHARED ${templateparser_LIB_SRCS} )
target_link_libraries( templateparser messageviewer ${KDE4_KIO_LIBS} ${KDE4_KMIME_LIBRARY} ${KDEPIMLIBS_AKONADI_LIBS} ${KDEPIMLIBS_KPIMTEXTEDIT_LIBS} ${KDEPIMLIBS_KPIMIDENTITIES_LIBS}
 messagecore kleo kpgp ${QGPGME_LIBRARIES} ${QT_QTWEBKIT_LIBRARY} )
set_target_properties( templateparser PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION} )

install( TARGETS templateparser ${INSTALL_TARGETS_DEFAULT_ARGS} )

install(FILES
  customtemplates_kfg.kcfg
  templatesconfiguration_kfg.kcfg
  DESTINATION ${KCFG_INSTALL_DIR}
)

