include(FindPkgConfig)

pkg_check_modules(PROCESS_CPP process-cpp REQUIRED)
pkg_check_modules(SF_CLIENT storage-framework-qt-client-2>=0.2 REQUIRED)
pkg_check_modules(SF_PROVIDER storage-framework-provider-1>=0.2 REQUIRED)

include_directories(
    ${CMAKE_SOURCE_DIR}/provider
    ${CMAKE_CURRENT_BINARY_DIR}
    ${CMAKE_CURRENT_SOURCE_DIR}
)

configure_file(testsetup.h.in testsetup.h @ONLY)

find_package(Qt5DBus REQUIRED)
find_package(Qt5Test REQUIRED)
find_package(Boost COMPONENTS filesystem system thread REQUIRED)

add_executable(
    mcloud-provider-unit-test
    mcloud-provider-unit-tests.cpp
    ${generated_files}
)

target_link_libraries(
    mcloud-provider-unit-test
    mcloud-provider-static
    mcloud
    Qt5::Test
    testutils
    gtest
    ${Boost_LIBRARIES}
    ${PROCESS_CPP_LDFLAGS}
)

add_test(
    mcloud-provider-unit-test 
    mcloud-provider-unit-test
)

add_definitions(-DBOOST_THREAD_VERSION=4)

add_subdirectory(utils)
