add_library(project_lib STATIC
    projectindex.cpp
    projectindex.h
    symbolindex.cpp
    symbolindex.h
    kateprojectbridge.cpp
    kateprojectbridge.h
)
target_link_libraries(project_lib PUBLIC
    Qt6::Core
)
target_include_directories(project_lib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

if(Qt6Test_FOUND)
    add_executable(test_projectindex test_projectindex.cpp)
    target_link_libraries(test_projectindex PRIVATE project_lib Qt6::Core Qt6::Test)
    add_test(NAME projectindex COMMAND test_projectindex)

    add_executable(test_symbolindex test_symbolindex.cpp)
    target_link_libraries(test_symbolindex PRIVATE project_lib Qt6::Core Qt6::Test)
    add_test(NAME symbolindex COMMAND test_symbolindex)

    add_executable(test_kateprojectbridge test_kateprojectbridge.cpp)
    target_link_libraries(test_kateprojectbridge PRIVATE project_lib Qt6::Core Qt6::Test)
    add_test(NAME kateprojectbridge COMMAND test_kateprojectbridge)
endif()
