qt_add_library(westernsupport STATIC
    candidatescallback.cpp candidatescallback.h
    spellchecker.cpp spellchecker.h
    spellpredictworker.cpp spellpredictworker.h
    westernlanguagefeatures.cpp westernlanguagefeatures.h
    westernlanguagesplugin.cpp westernlanguagesplugin.h
    westernsupport.cpp westernsupport.h
    westernsupport_global.h
)
set_target_properties(westernsupport PROPERTIES POSITION_INDEPENDENT_CODE ON)

target_include_directories(westernsupport PUBLIC
  $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
)

target_compile_definitions(westernsupport PRIVATE
    WESTERNSUPPORT_LIBRARY
    HUNSPELL_DICT_PATH=\"${HUNSPELL_DICT_PATH}\"
)

target_link_libraries(westernsupport PUBLIC
    Qt::Core
    Qt6::Core5Compat
    PkgConfig::MALIIT6_PLUGINS
    PkgConfig::HUNSPELL
    ${PRESAGE}
    languageplugin
)

install(TARGETS westernsupport
    LIBRARY DESTINATION ${LOMIRI_KEYBOARD_LIB_DIR}
)
install(FILES westernlanguagesplugin.h
    DESTINATION ${LOMIRI_KEYBOARD_HEADERS_DIR}
)
