d259e347e6
This change enables automatic detection and consumption of Mbed TLS library targets from within other CMake projects. By generating an `MbedTLSConfig.cmake` file, consuming projects receive a more complete view of these targets, allowing them to be used as dependencies which properly inherit the transitive dependencies of the libraries. This is fairly fragile, as it seems Mbed TLS's libraries do not appear to properly model their dependencies on other targets, including third-party dependencies. It is, however, sufficient for building and linking the compiled Mbed TLS libraries when there are no third-party dependencies involved. Further work is needed for more complex use-cases, but this will likely meet the needs of most projects. Resolves #298. Probably useful for #2857. Signed-off-by: Chris Kay <chris.kay@arm.com>
27 lines
856 B
CMake
27 lines
856 B
CMake
add_library(everest
|
|
library/everest.c
|
|
library/x25519.c
|
|
library/Hacl_Curve25519_joined.c)
|
|
|
|
target_include_directories(everest
|
|
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
|
$<BUILD_INTERFACE:${MBEDTLS_DIR}/include>
|
|
$<INSTALL_INTERFACE:include>
|
|
PRIVATE include/everest
|
|
include/everest/kremlib
|
|
${MBEDTLS_DIR}/library/)
|
|
|
|
if(INSTALL_MBEDTLS_HEADERS)
|
|
|
|
install(DIRECTORY include/everest
|
|
DESTINATION include
|
|
FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
|
|
DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
|
|
FILES_MATCHING PATTERN "*.h")
|
|
|
|
endif(INSTALL_MBEDTLS_HEADERS)
|
|
|
|
install(TARGETS everest
|
|
EXPORT MbedTLSTargets
|
|
DESTINATION ${LIB_INSTALL_DIR}
|
|
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
|