if(ENABLE_QT6)
    pkg_check_modules(QTDBUSTEST_DEPS REQUIRED IMPORTED_TARGET libqtdbustest-qt6)
else()
    pkg_check_modules(QTDBUSTEST_DEPS REQUIRED IMPORTED_TARGET libqtdbustest-1)
endif()

set_source_files_properties(${CMAKE_SOURCE_DIR}/data/provider.xml PROPERTIES
    CLASSNAME ProviderClient
    INCLUDE lomiri/storage/internal/dbusmarshal.h
)
qt_add_dbus_interface(generated_files
    ${CMAKE_SOURCE_DIR}/data/provider.xml
    ProviderClient
)
set_source_files_properties(${generated_files} PROPERTIES GENERATED TRUE)

add_library(testutils STATIC
  DBusEnvironment.cpp
  ProviderFixture.cpp
  gtest_printer.cpp
  ${generated_files}
)
target_link_libraries(testutils
  PUBLIC
    Qt${QT_VERSION_MAJOR}::DBus
    Qt${QT_VERSION_MAJOR}::Core
  PRIVATE
    Qt${QT_VERSION_MAJOR}::Test
    PkgConfig::QTDBUSTEST_DEPS
    PkgConfig::ONLINEACCOUNTS_DEPS
)

add_definitions(-DBOOST_THREAD_VERSION=4)
