add_library(KSyntaxHighlighting STATIC)

target_compile_definitions(KSyntaxHighlighting PRIVATE
    KSYNTAXHIGHLIGHTING_LIBRARY
    HAS_SYNTAX_RESOURCE
)

target_sources(KSyntaxHighlighting PRIVATE
    autogenerated/ksyntaxhighlighting_logging.cpp
    data/syntax/syntax-data.qrc
    data/themes/theme-data.qrc
    src/abstracthighlighter.cpp
    src/context.cpp
    src/contextswitch.cpp
    src/definition.cpp
    src/definitiondownloader.cpp
    src/foldingregion.cpp
    src/format.cpp
    src/htmlhighlighter.cpp
    src/keywordlist.cpp
    src/repository.cpp
    src/rule.cpp
    src/state.cpp
    src/syntaxhighlighter.cpp
    src/theme.cpp
    src/themedata.cpp
    src/wildcardmatcher.cpp
    src/worddelimiters.cpp
)

target_include_directories(KSyntaxHighlighting
    PUBLIC
        ${CMAKE_CURRENT_SOURCE_DIR}/include
        ${CMAKE_CURRENT_BINARY_DIR}
    PRIVATE
        ${CMAKE_CURRENT_SOURCE_DIR}/autogenerated
        ${CMAKE_CURRENT_SOURCE_DIR}/src
)

target_link_libraries(KSyntaxHighlighting
    Qt5::Core
    Qt5::Widgets
    Qt5::Network
)

include(GenerateExportHeader)
generate_export_header(KSyntaxHighlighting BASE_NAME KSyntaxHighlighting)
