Files
MicrOBU/obu-firmware/external/vanetza-idf/vanetza/geodesy/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

49 lines
1.8 KiB
CMake

add_vanetza_component(geodesy
country_data_reader.cpp
country_database.cpp
geodesy.cpp
haversine.cpp
)
if(VANETZA_WITH_GEOGRAPHICLIB)
target_sources(geodesy PRIVATE geographiclib.cpp)
target_link_libraries(geodesy PRIVATE GeographicLib::GeographicLib)
target_compile_definitions(geodesy PUBLIC VANETZA_WITH_GEOGRAPHICLIB)
endif()
if(VANETZA_EMBED_COUNTRY_DATA)
find_program(UV_EXECUTABLE uv REQUIRED)
set(VANETZA_COUNTRY_DATA_RESOLUTION "50m" CACHE STRING
"Natural Earth resolution for country data (110m, 50m, 10m)")
set_property(CACHE VANETZA_COUNTRY_DATA_RESOLUTION PROPERTY STRINGS 110m 50m 10m)
set(_tool_dir "${PROJECT_SOURCE_DIR}/tools/country-data")
set(_country_bin "${CMAKE_CURRENT_BINARY_DIR}/country_data.bin")
set(_embedded_cpp "${CMAKE_CURRENT_BINARY_DIR}/country_data_embedded.cpp")
add_custom_command(
OUTPUT "${_country_bin}"
COMMAND "${UV_EXECUTABLE}" run "${_tool_dir}/convert.py"
--resolution "${VANETZA_COUNTRY_DATA_RESOLUTION}"
--output "${_country_bin}"
DEPENDS "${_tool_dir}/convert.py"
COMMENT "Converting Natural Earth ${VANETZA_COUNTRY_DATA_RESOLUTION} to country data binary"
VERBATIM
)
add_custom_command(
OUTPUT "${_embedded_cpp}"
COMMAND "${UV_EXECUTABLE}" run "${_tool_dir}/embed.py"
--input "${_country_bin}"
--output "${_embedded_cpp}"
DEPENDS "${_country_bin}" "${_tool_dir}/embed.py"
COMMENT "Generating embedded country data source"
VERBATIM
)
target_sources(geodesy PRIVATE "${_embedded_cpp}")
target_link_libraries(geodesy PRIVATE common)
target_compile_definitions(geodesy PUBLIC VANETZA_WITH_EMBEDDED_COUNTRY_DATA)
endif()
add_test_subdirectory(tests)