set(TRACK_CORE_SOURCES src/memory_strip.cpp src/model.cpp src/pid_program.cpp src/pid_runtime.cpp src/render.cpp src/scheme_decoder.cpp src/scheme_runtime.cpp ) if(DEFINED IDF_TARGET) idf_component_register( SRCS ${TRACK_CORE_SOURCES} INCLUDE_DIRS include ) target_compile_features(${COMPONENT_LIB} PUBLIC cxx_std_23) else() cmake_minimum_required(VERSION 3.20) project(track_core VERSION 0.1.0 LANGUAGES CXX) add_library(track_core ${TRACK_CORE_SOURCES}) add_library(track_core::track_core ALIAS track_core) target_include_directories(track_core PUBLIC $ $ ) target_compile_features(track_core PUBLIC cxx_std_23) option(TRACK_CORE_BUILD_PYTHON "Build Python bindings" OFF) option(TRACK_CORE_BUILD_TESTS "Build track-core tests" ON) if(TRACK_CORE_BUILD_PYTHON) find_package(Python 3.9 COMPONENTS Interpreter Development.Module REQUIRED) find_package(nanobind CONFIG REQUIRED) nanobind_add_module(_core src/python/bindings.cpp ) target_link_libraries(_core PRIVATE track_core::track_core) target_compile_features(_core PRIVATE cxx_std_23) install(TARGETS _core LIBRARY DESTINATION track_core) endif() if(TRACK_CORE_BUILD_TESTS) enable_testing() add_executable(track_core_tests tests/track_core_tests.cpp) target_link_libraries(track_core_tests PRIVATE track_core::track_core) target_compile_features(track_core_tests PRIVATE cxx_std_23) add_test(NAME track_core_tests COMMAND track_core_tests) endif() add_executable(track_core_render_demo examples/render_demo.cpp) target_link_libraries(track_core_render_demo PRIVATE track_core::track_core) target_compile_features(track_core_render_demo PRIVATE cxx_std_23) endif()