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).
111 lines
3.9 KiB
CMake
111 lines
3.9 KiB
CMake
if(NOT TARGET Boost::program_options)
|
|
message(STATUS "Skip build of socktap because of missing Boost::program_options dependency")
|
|
return()
|
|
endif()
|
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
add_executable(socktap
|
|
application.cpp
|
|
benchmark_application.cpp
|
|
cam_application.cpp
|
|
dcc_passthrough.cpp
|
|
ethernet_device.cpp
|
|
hello_application.cpp
|
|
link_layer.cpp
|
|
main.cpp
|
|
positioning.cpp
|
|
raw_socket_link.cpp
|
|
router_context.cpp
|
|
security.cpp
|
|
tcp_link.cpp
|
|
time_trigger.cpp
|
|
udp_link.cpp
|
|
certificate_validation_v3.cpp
|
|
)
|
|
target_link_libraries(socktap PUBLIC Boost::program_options Threads::Threads vanetza)
|
|
|
|
if(VANETZA_WITH_PQC)
|
|
target_sources(socktap PRIVATE certificate_validation_v3_pqc.cpp)
|
|
else()
|
|
target_sources(socktap PRIVATE certificate_validation_v3_strict.cpp)
|
|
endif()
|
|
|
|
if (TARGET rpc)
|
|
set(SOCKTAP_WITH_RPC_DEFAULT ON)
|
|
else()
|
|
set(SOCKTAP_WITH_RPC_DEFAULT OFF)
|
|
endif()
|
|
option(SOCKTAP_WITH_RPC "Enable RPC support for socktap" ${SOCKTAP_WITH_RPC_DEFAULT})
|
|
if (SOCKTAP_WITH_RPC)
|
|
target_sources(socktap PRIVATE rpc_link.cpp)
|
|
target_link_libraries(socktap PUBLIC rpc)
|
|
target_compile_definitions(socktap PUBLIC SOCKTAP_WITH_RPC)
|
|
endif()
|
|
|
|
# cube evk board from nfiniity
|
|
option(SOCKTAP_WITH_CUBE_EVK "Use cube evk for socktap" OFF)
|
|
if (SOCKTAP_WITH_CUBE_EVK)
|
|
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG TRUE)
|
|
find_package(Protobuf REQUIRED)
|
|
protobuf_generate(TARGET socktap PROTOS nfiniity_cube_radio.proto)
|
|
target_compile_definitions(socktap PUBLIC "SOCKTAP_WITH_CUBE_EVK")
|
|
target_sources(socktap PRIVATE nfiniity_cube_evk_link.cpp nfiniity_cube_evk.cpp)
|
|
target_include_directories(socktap PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
|
target_link_libraries(socktap PUBLIC protobuf::libprotobuf)
|
|
|
|
if (Protobuf_VERSION VERSION_GREATER_EQUAL "22.0")
|
|
set_property(TARGET socktap PROPERTY CXX_STANDARD 17)
|
|
endif()
|
|
endif()
|
|
|
|
option(SOCKTAP_WITH_AUTOTALKS "Use Autotalks API for socktap" OFF) # Both Secton and Craton devices
|
|
if (SOCKTAP_WITH_AUTOTALKS)
|
|
find_package(Autotalks MODULE REQUIRED)
|
|
target_compile_definitions(socktap PUBLIC "SOCKTAP_WITH_AUTOTALKS")
|
|
if(NOT AUTOTALKS_CRATON)
|
|
target_compile_definitions(socktap PUBLIC "SECTON")
|
|
target_link_libraries(socktap PUBLIC Autotalks::AtlkRemote)
|
|
else ()
|
|
target_compile_definitions(socktap PUBLIC "CRATON_2")
|
|
target_link_libraries(socktap PUBLIC Autotalks::AtlkLocal)
|
|
endif()
|
|
target_include_directories(socktap PUBLIC ${AUTOTALKS_INCLUDE_DIRS})
|
|
target_sources(socktap PRIVATE autotalks.cpp autotalks_link.cpp)
|
|
endif()
|
|
|
|
set_target_properties(socktap PROPERTIES INSTALL_RPATH $ORIGIN/../${CMAKE_INSTALL_LIBDIR})
|
|
install(TARGETS socktap DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
|
|
find_file(COHDA_LLC_API_HEADER llc-api.h
|
|
HINTS "/home/duser"
|
|
PATH_SUFFIXES "cohda/kernel/include/linux/cohda/llc"
|
|
CMAKE_FIND_ROOT_PATH_BOTH
|
|
DOC "Cohda LLC API header")
|
|
mark_as_advanced(COHDA_LLC_API_HEADER)
|
|
if(COHDA_LLC_API_HEADER)
|
|
set(COHDA_LLC_API_FOUND ON)
|
|
else()
|
|
set(COHDA_LLC_API_FOUND OFF)
|
|
endif()
|
|
|
|
option(SOCKTAP_WITH_COHDA_LLC "Enable Cohda LLC link layer for socktap" ${COHDA_LLC_API_FOUND})
|
|
if(SOCKTAP_WITH_COHDA_LLC)
|
|
if(NOT COHDA_LLC_API_HEADER)
|
|
message(SEND_ERROR "Cohda LLC API header [llc-api.h] is missing")
|
|
endif()
|
|
get_filename_component(COHDA_LLC_INCLUDE_DIR ${COHDA_LLC_API_HEADER} DIRECTORY)
|
|
target_compile_definitions(socktap PUBLIC "SOCKTAP_WITH_COHDA_LLC")
|
|
target_include_directories(socktap PUBLIC ${COHDA_LLC_INCLUDE_DIR})
|
|
target_sources(socktap PRIVATE cohda.cpp cohda_link.cpp)
|
|
endif()
|
|
|
|
find_package(GPS QUIET)
|
|
option(SOCKTAP_WITH_GPSD "Enable gpsd positioning for socktap" ${GPS_FOUND})
|
|
if(SOCKTAP_WITH_GPSD)
|
|
find_package(GPS REQUIRED)
|
|
target_compile_definitions(socktap PUBLIC "SOCKTAP_WITH_GPSD")
|
|
target_link_libraries(socktap PUBLIC GPS::GPS)
|
|
target_sources(socktap PRIVATE gps_position_provider.cpp)
|
|
endif()
|