Files
MicrOBU/microbu-esp32c5/external/vanetza-idf/cmake/FindGeographicLib.cmake
T
Ashin Walpola 0e9525162d 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).
2026-09-23 17:46:40 +02:00

55 lines
2.5 KiB
CMake

option(GeographicLib_PREFER_PACKAGE_CONFIG "Prefer CMake config mode" ON)
mark_as_advanced(GeographicLib_PREFER_PACKAGE_CONFIG)
if(GeographicLib_PREFER_PACKAGE_CONFIG)
find_package(GeographicLib ${GeographicLib_FIND_VERSION} QUIET CONFIG)
if (GeographicLib_FOUND)
message(STATUS "GeographicLib: using found CMake configuration")
return()
endif()
endif()
message(STATUS "GeographicLib: using lookup code by Vanetza")
find_path(GeographicLib_INCLUDE_DIR NAMES GeographicLib/Config.h DOC "GeographicLib include directory")
find_library(GeographicLib_LIBRARY_RELEASE NAMES Geographic GeographicLib DOC "GeographicLib library (release)")
find_library(GeographicLib_LIBRARY_DEBUG NAMES Geographic_d GeographicLib_d DOC "GeographicLib library (debug)")
include(SelectLibraryConfigurations)
select_library_configurations(GeographicLib)
if(GeographicLib_INCLUDE_DIR)
file(STRINGS ${GeographicLib_INCLUDE_DIR}/GeographicLib/Config.h _config_version REGEX "GEOGRAPHICLIB_VERSION_STRING")
string(REGEX MATCH "\"([0-9.]+)\"$" _match_version ${_config_version})
set(GeographicLib_VERSION_STRING ${CMAKE_MATCH_1})
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GeographicLib
REQUIRED_VARS GeographicLib_INCLUDE_DIR GeographicLib_LIBRARY
FOUND_VAR GeographicLib_FOUND
VERSION_VAR GeographicLib_VERSION_STRING)
if(GeographicLib_FOUND AND NOT TARGET GeographicLib::GeographicLib)
add_library(GeographicLib::GeographicLib UNKNOWN IMPORTED)
set_target_properties(GeographicLib::GeographicLib PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${GeographicLib_INCLUDE_DIR}"
IMPORTED_LOCATION "${GeographicLib_LIBRARY}"
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX")
if(EXISTS "${GeographicLib_LIBRARY_RELEASE}")
set_property(TARGET GeographicLib::GeographicLib APPEND PROPERTY
IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(GeographicLib::GeographicLib PROPERTIES
IMPORTED_LOCATION_RELEASE "${GeographicLib_LIBRARY_RELEASE}")
endif()
if(EXISTS "${GeographicLib_LIBRARY_DEBUG}")
set_property(TARGET GeographicLib::GeographicLib APPEND PROPERTY
IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(GeographicLib::GeographicLib PROPERTIES
IMPORTED_LOCATION_DEBUG "${GeographicLib_LIBRARY_DEBUG}")
endif()
endif()
mark_as_advanced(GeographicLib_INCLUDE_DIR GeographicLib_LIBRARY)
set(GeographicLib_INCLUDE_DIRS ${GeographicLib_INCLUDE_DIR})
# GeographicLib_LIBRARIES is set by SelectLibraryConfigurations