Keep the colleague's microbu-esp32c5 tree in this repository

obu-firmware builds against vanetza-idf from microbu-esp32c5/external, but
that tree was gitignored, so a clone of this repository could not build the
firmware it ships. It is now committed here as ordinary files in its own
folder, microbu-esp32c5/: the colleague's commit cf4b99f plus the V2X2MAP
bridge's signature verification (--trust) used on the bench. Nothing is
fetched from or pushed to the colleague's repository; this repository and
its remotes carry everything. The folder's own .gitignore keeps build output,
downloaded components and private key material out, as it did there; the
committed file set is identical to that repository's tracked files.

The ESP32-C5 is still flashed from obu-firmware/, which only takes
vanetza-idf from microbu-esp32c5/, so the two stay separate folders.
FLASHING.md says how to take a newer version of the colleague's tree (copy
it over the folder, rebuild, test, commit).
This commit is contained in:
Ashin Walpola
2026-09-23 17:46:40 +02:00
parent 2f60623e18
commit 0e9525162d
9881 changed files with 1582523 additions and 17 deletions
@@ -0,0 +1,66 @@
set(GTest_VERSION 1.16.0)
set(GTest_ARCHIVE_NAME googletest-${GTest_VERSION})
set(GTest_ARCHIVE ${GTest_ARCHIVE_NAME}.tar.gz)
set(GTest_ARCHIVE_SHA1 517f27ed21b40f9927ab91f2abc147519cedb5a5)
set(GTest_URL https://github.com/google/googletest/releases/download/v${GTest_VERSION}/${GTest_ARCHIVE})
option(GTest_BUILD_DIRECTORY_DOWNLOAD "Download GoogleTest in build directory" OFF)
mark_as_advanced(GTest_BUILD_DIRECTORY_DOWNLOAD)
if(GTest_BUILD_DIRECTORY_DOWNLOAD)
set(GTest_DIR ${PROJECT_BINARY_DIR}/gtest)
else()
set(GTest_DIR ${PROJECT_SOURCE_DIR}/gtest)
endif()
set(GTest_ARCHIVE_DIR ${GTest_DIR}/${GTest_ARCHIVE_NAME}/googletest)
set(GTest_SOURCE_DIR ${GTest_ARCHIVE_DIR}/src)
set(GTest_INCLUDE_DIR ${GTest_ARCHIVE_DIR}/include)
set(GTest_LIBRARY gtest)
set(GTest_LIBRARY_SOURCES ${GTest_SOURCE_DIR}/gtest-all.cc)
set(GTest_MAIN_LIBRARY gtest_main)
set(GTest_MAIN_LIBRARY_SOURCES ${GTest_SOURCE_DIR}/gtest_main.cc)
file(DOWNLOAD
${GTest_URL}
${GTest_DIR}/${GTest_ARCHIVE}
EXPECTED_HASH SHA1=${GTest_ARCHIVE_SHA1})
add_custom_target(download_gtest DEPENDS ${GTest_DIR}/${GTest_ARCHIVE})
add_custom_command(
OUTPUT ${GTest_LIBRARY_SOURCES} ${GTest_MAIN_LIBRARY_SOURCES}
COMMAND ${CMAKE_COMMAND} -E tar xfz ${GTest_DIR}/${GTest_ARCHIVE}
DEPENDS download_gtest
COMMENT "Extracting ${GTest_ARCHIVE} in ${GTest_DIR}"
WORKING_DIRECTORY ${GTest_DIR}
VERBATIM)
add_custom_target(extract_gtest DEPENDS ${GTest_LIBRARY_SOURCES} ${GTest_MAIN_LIBRARY_SOURCES})
# GTest library for tests with own main function
add_library(${GTest_LIBRARY} ${GTest_LIBRARY_SOURCES})
target_include_directories(${GTest_LIBRARY} PRIVATE ${GTest_ARCHIVE_DIR})
target_include_directories(${GTest_LIBRARY} SYSTEM PUBLIC ${GTest_INCLUDE_DIR})
add_dependencies(${GTest_LIBRARY} extract_gtest)
# GTest library providing main function for tests
add_library(${GTest_MAIN_LIBRARY} ${GTest_MAIN_LIBRARY_SOURCES})
target_link_libraries(${GTest_MAIN_LIBRARY} PUBLIC ${GTest_LIBRARY})
add_dependencies(${GTest_MAIN_LIBRARY} extract_gtest)
# Look for threading library and configure GTest accordingly
if(NOT DEFINED CMAKE_USE_PTHREADS_INIT)
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_package(Threads MODULE)
endif()
if(CMAKE_USE_PTHREADS_INIT)
message(STATUS "Build GTest with pthread support")
target_compile_definitions(${GTest_LIBRARY} PUBLIC "GTEST_HAS_PTHREAD=1")
target_link_libraries(${GTest_LIBRARY} PUBLIC Threads::Threads)
else()
message(STATUS "Build GTest without threading")
target_compile_definitions(${GTest_LIBRARY} PUBLIC "GTEST_HAS_PTHREAD=0")
endif()
set_target_properties(download_gtest extract_gtest ${GTest_LIBRARY} ${GTest_MAIN_LIBRARY}
PROPERTIES FOLDER "GTest")