RoboidControl-cpp/CMakeLists.txt
2023-12-30 14:32:19 +00:00

53 lines
992 B
CMake

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)
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)
add_library(RoboidControl STATIC
"Roboid.cpp"
)
enable_testing()
add_executable(
RoboidControlTest
"test/Dummy_test.cc"
)
target_link_libraries(
RoboidControlTest
gtest_main
RoboidControl
)
include(GoogleTest)
gtest_discover_tests(RoboidControlTest)