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

32 lines
1.4 KiB
CMake

find_path(CryptoPP_INCLUDE_DIR NAMES cryptopp/config.h DOC "CryptoPP include directory")
find_library(CryptoPP_LIBRARY NAMES cryptopp DOC "CryptoPP library")
if(CryptoPP_INCLUDE_DIR)
# CRYPTOPP_VERSION has been moved to config_ver.h starting with Crypto++ 8.3
if(EXISTS ${CryptoPP_INCLUDE_DIR}/cryptopp/config_ver.h)
set(CryptoPP_VERSION_HEADER "config_ver.h")
else()
set(CryptoPP_VERSION_HEADER "config.h")
endif()
file(STRINGS ${CryptoPP_INCLUDE_DIR}/cryptopp/${CryptoPP_VERSION_HEADER} _config_version REGEX "CRYPTOPP_VERSION")
string(REGEX MATCH "([0-9])([0-9])([0-9])" _match_version "${_config_version}")
set(CryptoPP_VERSION_STRING "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3}")
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(CryptoPP
REQUIRED_VARS CryptoPP_INCLUDE_DIR CryptoPP_LIBRARY
FOUND_VAR CryptoPP_FOUND
VERSION_VAR CryptoPP_VERSION_STRING)
if(CryptoPP_FOUND AND NOT TARGET CryptoPP::CryptoPP)
add_library(CryptoPP::CryptoPP UNKNOWN IMPORTED)
set_target_properties(CryptoPP::CryptoPP PROPERTIES
IMPORTED_LOCATION "${CryptoPP_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${CryptoPP_INCLUDE_DIR}")
endif()
mark_as_advanced(CryptoPP_INCLUDE_DIR CryptoPP_LIBRARY)
set(CryptoPP_INCLUDE_DIRS ${CryptoPP_INCLUDE_DIR})
set(CryptoPP_LIBRARIES ${CryptoPP_LIBRARY})