set(CMAKE_AUTOMOC ON)

add_library(core STATIC
    BackupFormatModel.cpp
    CsvWriter.cpp
    my_boost_assert_handler.cpp
    PasswordManager.cpp
    SqlLexer.cpp)
    
target_link_libraries(core PUBLIC
    boost
    botan
    Qt5::Core
    )
    
target_include_directories(core INTERFACE
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
)

set_target_properties(core PROPERTIES 
    CXX_STANDARD 14
    CXX_STANDARD_REQUIRED ON
    POSITION_INDEPENDENT_CODE True
    )

add_executable(runtests 
    test/main.cpp
    test/tst_CsvWriter.cpp
    test/tst_expected.cpp
    test/tst_PasswordManager.cpp
    test/tst_scopeguard.cpp
    test/tst_SqlLexer.cpp
    )
    
target_link_libraries(runtests 
    core 
    gtest
    Threads::Threads
    )

add_test(tests runtests)
