72 lines
1.4 KiB
CMake
72 lines
1.4 KiB
CMake
cmake_minimum_required(VERSION 3.13) # CMake version check
|
|
if(ESP_PLATFORM)
|
|
set(sourcedirs
|
|
.
|
|
VectorAlgebra
|
|
)
|
|
|
|
set(includedirs
|
|
.
|
|
VectorAlgebra
|
|
)
|
|
|
|
idf_component_register(
|
|
SRC_DIRS ${sourcedirs}
|
|
INCLUDE_DIRS ${includedirs}
|
|
REQUIRES arduino
|
|
)
|
|
endif()
|
|
|
|
project(RoboidControl)
|
|
add_subdirectory(VectorAlgebra)
|
|
add_subdirectory(test)
|
|
|
|
set(CMAKE_CXX_STANDARD 11)
|
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
|
|
add_compile_definitions(GTEST)
|
|
include(FetchContent)
|
|
FetchContent_Declare(
|
|
googletest
|
|
URL https://github.com/google/googletest/archive/refs/heads/main.zip
|
|
)
|
|
|
|
# For Windows: Prevent overriding the parent project's compiler/linker settings
|
|
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
|
FetchContent_MakeAvailable(googletest)
|
|
|
|
include_directories(
|
|
.
|
|
VectorAlgebra
|
|
)
|
|
|
|
add_library(RoboidControl STATIC
|
|
"Roboid.cpp"
|
|
"Perception.cpp"
|
|
"TrackedObject.cpp"
|
|
"Propulsion.cpp"
|
|
"Motor.cpp"
|
|
"DifferentialDrive.cpp"
|
|
"DistanceSensor.cpp"
|
|
"Sensor.cpp"
|
|
"Switch.cpp"
|
|
"Thing.cpp"
|
|
"Quadcopter.cpp"
|
|
)
|
|
|
|
enable_testing()
|
|
|
|
# add_executable(
|
|
# RoboidControlTest
|
|
# "test/BB2B_Test.cc"
|
|
# )
|
|
# target_link_libraries(
|
|
# RoboidControlTest
|
|
# gtest_main
|
|
# RoboidControl
|
|
# VectorAlgebra
|
|
# )
|
|
|
|
include(GoogleTest)
|
|
# gtest_discover_tests(RoboidControlTest)
|