find_package(TreelandProtocols REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_check_modules(WAYLAND_CLIENT REQUIRED IMPORTED_TARGET wayland-client)
pkg_check_modules(XKBCOMMON REQUIRED IMPORTED_TARGET xkbcommon)

option(TREELAND_ENABLE_UINPUT_PROTOCOL_TESTS
    "Build optional /dev/uinput protocol integration tests" OFF)

set(TREELAND_PROTOCOL_TEST_DSG_DATA_DIR "${CMAKE_CURRENT_BINARY_DIR}/dsg")
file(COPY "${PROJECT_SOURCE_DIR}/misc/dconfig/"
    DESTINATION "${TREELAND_PROTOCOL_TEST_DSG_DATA_DIR}/configs/org.deepin.dde.treeland")
set(TREELAND_PROTOCOL_TEST_DSG_DATA_DIRS
    "${TREELAND_PROTOCOL_TEST_DSG_DATA_DIR}:/usr/share/dsg")

include(${CMAKE_CURRENT_SOURCE_DIR}/framework/ProtocolTest.cmake)

add_subdirectory(treeland-app-id-resolver-v1)
add_subdirectory(treeland-app-id-resolver-desktop-v1)
add_subdirectory(treeland-capture-unstable-v1)
add_subdirectory(treeland-capture-desktop-v1)
add_subdirectory(treeland-dde-shell-v1)
add_subdirectory(treeland-dde-shell-desktop-v1)
add_subdirectory(treeland-dde-shell-lockscreen-desktop-v1)
add_subdirectory(treeland-dde-shell-multitask-desktop-v1)
add_subdirectory(treeland-dde-shell-picker-desktop-v1)
add_subdirectory(treeland-ddm-v1)
add_subdirectory(treeland-foreign-toplevel-manager-v1)
add_subdirectory(treeland-input-manager-unstable-v1)
if(TREELAND_ENABLE_UINPUT_PROTOCOL_TESTS AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
    add_subdirectory(treeland-input-manager-uinput-v1)
endif()
add_subdirectory(treeland-keyboard-state-notify-unstable-v1)
add_subdirectory(treeland-output-manager-v1)
add_subdirectory(treeland-personalization-manager-v1)
add_subdirectory(treeland-personalization-desktop-v1)
add_subdirectory(treeland-prelaunch-splash-v2)
add_subdirectory(treeland-prelaunch-splash-desktop-v2)
add_subdirectory(treeland-screensaver-v1)
add_subdirectory(treeland-screensaver-desktop-v1)
add_subdirectory(treeland-shortcut-manager-v2)
add_subdirectory(treeland-shortcut-manager-desktop-v2)
add_subdirectory(treeland-virtual-output-manager-v1)
add_subdirectory(treeland-virtual-output-desktop-v1)
add_subdirectory(treeland-wallpaper-color-v1)
add_subdirectory(treeland-wallpaper-manager-unstable-v1)
add_subdirectory(treeland-wallpaper-shell-unstable-v1)
add_subdirectory(treeland-wallpaper-desktop-v1)
add_subdirectory(treeland-window-management-v1)
add_subdirectory(treeland-window-management-desktop-v1)
add_subdirectory(treeland-wine-window-state-unstable-v1)
add_subdirectory(treeland-wine-window-management-unstable-v1)
