RoboidControl-cpp/CMakeLists.txt
2023-12-31 09:08:39 +01:00

62 lines
1.2 KiB
CMake

cmake_minimum_required(VERSION 3.13) # CMake version check
if(ESP_PLATFORM)
set(sourcedirs
.
VectorAlgebra/src
)
set(includedirs
.
VectorAlgebra/include
)
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/include
)
add_library(RoboidControl STATIC
"Roboid.cpp"
)
enable_testing()
add_executable(
RoboidControlTest
"test/Dummy_test.cc"
)
target_link_libraries(
RoboidControlTest
gtest_main
RoboidControl
VectorAlgebra
)
include(GoogleTest)
gtest_discover_tests(RoboidControlTest)