Files
kinect/CMakeLists.txt
T
kinect-bot 4a66699d82
ci / Linux C++ core (cmake + ctest) (push) Canceled after 0s
ci / Python tracker (pytest) (push) Canceled after 0s
feat(mapping,tracker,tools): NUI mapping+smoothing, MediaPipe tracker, record/replay harness, mock NUI host (wave 3)
2026-11-25 04:21:18 -05:00

57 lines
2.3 KiB
CMake

cmake_minimum_required(VERSION 3.20)
project(virtual_kinect_core LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# ---------------------------------------------------------------------------
# libnui_core: OS-agnostic static library aggregating the pure core modules.
# Real logic arrives per plan todos 2 (contract), 6 (mapping), 7 (synth);
# these sources are compile/link placeholders today.
# ---------------------------------------------------------------------------
add_library(libnui_core STATIC
core/contract/contract.cpp
core/mapping/mapping.cpp
core/synth/synth.cpp
)
# Keep the on-disk name libnui_core.a (not liblibnui_core.a).
set_target_properties(libnui_core PROPERTIES PREFIX "" OUTPUT_NAME "libnui_core")
target_include_directories(libnui_core PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/core)
# ---------------------------------------------------------------------------
# contract_layout_dump: prints the frozen contract's sizeof/offsetof golden
# table so tests/test_contract_py.py can check the Python ctypes mirror
# against the CURRENT C layout instead of a hardcoded, driftable copy.
# ---------------------------------------------------------------------------
add_executable(contract_layout_dump core/contract/contract_layout_dump.cpp)
target_link_libraries(contract_layout_dump PRIVATE libnui_core)
# ---------------------------------------------------------------------------
# Tests: GoogleTest via FetchContent + CTest.
# ---------------------------------------------------------------------------
option(NUI_CORE_BUILD_TESTS "Build libnui_core unit tests" ON)
if(NUI_CORE_BUILD_TESTS)
include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/refs/tags/v1.15.2.tar.gz
URL_HASH SHA256=7b42b4d6ed48810c5362c265a17faebe90dc2373c885e5216439d37927f02926
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
)
# Honour the parent project's C runtime selection on Windows/MSVC.
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
enable_testing()
add_executable(libnui_core_tests
tests/test_core.cpp
tests/test_contract.cpp
tests/test_mapping.cpp
)
target_link_libraries(libnui_core_tests PRIVATE libnui_core GTest::gtest_main)
include(GoogleTest)
gtest_discover_tests(libnui_core_tests)
endif()