Files
MicrOBU/obu-firmware/external/vanetza-idf/tools/socktap/CMakeLists.txt
T
Ashin Walpola d107534eb2 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.
2026-09-24 10:56:05 +02:00

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()