# Standalone, Windows-only build for the mock NUI host (plan todo 16).
#
# DELIBERATELY NOT referenced by the repository root CMakeLists.txt: this target
# needs windows.h and the Kinect for Windows SDK 1.8 import library, so it can
# only be configured on Windows with MSVC. The Linux core build never sees it.
#
# Build (on a Windows box with the Kinect SDK 1.8 installed):
#   cmake -S tools/mock-nui-host -B build/mock-nui-host -A Win32
#   cmake --build build/mock-nui-host --config Release
# Use -A Win32 to match a 32-bit shim/game, or -A x64 for 64-bit.

cmake_minimum_required(VERSION 3.20)
project(mock_nui_host LANGUAGES CXX)

if(NOT WIN32)
  message(FATAL_ERROR "mock-nui-host is Windows-only (needs the Kinect SDK 1.8); do not build it on Linux.")
endif()

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

add_executable(mock_nui_host mock_nui_host.cpp)

# Kinect for Windows SDK 1.8 (KINECTSDK10_DIR is set by the SDK installer).
set(KINECT_SDK_DIR "$ENV{KINECTSDK10_DIR}" CACHE PATH "Kinect for Windows SDK 1.8 root")
if(NOT KINECT_SDK_DIR)
  message(FATAL_ERROR "KINECTSDK10_DIR not set; install the Kinect for Windows SDK 1.8.")
endif()

if(CMAKE_SIZEOF_VOID_P EQUAL 8)
  set(KINECT_ARCH "amd64")
else()
  set(KINECT_ARCH "x86")
endif()

target_include_directories(mock_nui_host PRIVATE "${KINECT_SDK_DIR}/inc")
target_link_libraries(mock_nui_host PRIVATE "${KINECT_SDK_DIR}/lib/${KINECT_ARCH}/Kinect10.lib")
