Keep vanetza-idf in obu-firmware, so a plain clone builds the firmware
obu-firmware builds against the vanetza-idf C-ITS library, which until now came from the colleague's microbu-esp32c5 tree beside the repository and was not tracked here, so a clone of this repository could not build the firmware it ships. The library alone is now part of obu-firmware, as obu-firmware/external/vanetza-idf: their external/vanetza-idf at commit cf4b99f, unchanged (9775 files; see its PROVENANCE.md). CMake takes it from there by default; -DVANETZA_IDF_DIR still points the build elsewhere. The rest of the colleague's tree (their own VAM firmware, PKI tooling, station-link Python tools, the V2X2MAP bridge) stays out of this repository and gitignored; nothing is pushed to their repository. NOTES.md, docs/06, TODO.md and the pcap verifier's usage line point at the new location.
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
#
|
||||
# configure_gtest_directory(
|
||||
# [SOURCES <srcs...>]
|
||||
# [LINK_LIBRARIES <libs...>]
|
||||
# [INCLUDE_DIRECTORIES <dirs...>]
|
||||
# [COMPILE_DEFINITIONS <defs...>])
|
||||
#
|
||||
# Set GTest properties common for all unit test executables in current directory.
|
||||
#
|
||||
function(configure_gtest_directory)
|
||||
cmake_parse_arguments(args "" "" "SOURCES;LINK_LIBRARIES;INCLUDE_DIRECTORIES;COMPILE_DEFINITIONS" ${ARGN})
|
||||
if(args_UNPARSED_ARGUMENTS)
|
||||
message(FATAL_ERROR "unknown arguments given to configure_gtest_directory: ${args_UNPARSED_ARGUMENTS}")
|
||||
endif()
|
||||
|
||||
set_property(DIRECTORY PROPERTY GTEST_SOURCES ${args_SOURCES})
|
||||
set_property(DIRECTORY PROPERTY GTEST_LINK_LIBRARIES ${args_LINK_LIBRARIES})
|
||||
set_property(DIRECTORY PROPERTY GTEST_INCLUDE_DIRECTORIES ${args_INCLUDE_DIRECTORIES})
|
||||
set_property(DIRECTORY PROPERTY GTEST_COMPILE_DEFINITIONS ${args_COMPILE_DEFINITIONS})
|
||||
endfunction()
|
||||
|
||||
#
|
||||
# add_gtest(<name>
|
||||
# [SOURCES] <srcs...>
|
||||
# [LINK_LIBRARIES <libs...>]
|
||||
# [INCLUDE_DIRECTORIES <dirs...>]
|
||||
# [COMPILE_DEFINITIONS <defs...>])
|
||||
#
|
||||
# Add a CTest unit test executable using Google Test.
|
||||
# The executable will be built as specified by given arguments and directory properties.
|
||||
#
|
||||
function(add_gtest name)
|
||||
set(target GTest_${name})
|
||||
cmake_parse_arguments(args "" "" "SOURCES;LINK_LIBRARIES;INCLUDE_DIRECTORIES;COMPILE_DEFINITIONS" ${ARGN})
|
||||
|
||||
get_directory_property(sources GTEST_SOURCES)
|
||||
list(APPEND sources "${args_SOURCES}" "${args_UNPARSED_ARGUMENTS}")
|
||||
get_directory_property(link_libraries GTEST_LINK_LIBRARIES)
|
||||
list(APPEND link_libraries "${args_LINK_LIBRARIES}" ${GTest_MAIN_LIBRARY})
|
||||
get_directory_property(include_directories GTEST_INCLUDE_DIRECTORIES)
|
||||
list(APPEND include_directories "${args_INCLUDE_DIRECTORIES}" ${GTest_INCLUDE_DIR})
|
||||
get_directory_property(compile_definitions GTEST_COMPILE_DEFINITIONS)
|
||||
list(APPEND compile_definitions "${args_COMPILE_DEFINITIONS}")
|
||||
|
||||
if(NOT sources)
|
||||
message(FATAL_ERROR "no sources given to add_gtest")
|
||||
endif()
|
||||
|
||||
add_executable(${target} ${sources})
|
||||
set_target_properties(${target} PROPERTIES
|
||||
RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/tests
|
||||
FOLDER "GTest"
|
||||
LINK_LIBRARIES "${link_libraries}"
|
||||
INCLUDE_DIRECTORIES "${include_directories}"
|
||||
COMPILE_DEFINITIONS "${compile_definitions}")
|
||||
add_test(NAME ${name}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
COMMAND ${target})
|
||||
endfunction()
|
||||
Reference in New Issue
Block a user