2023-09-28 18:52:52 +02:00
|
|
|
set(everest_target "${MBEDTLS_TARGET_PREFIX}everest")
|
|
|
|
|
|
|
|
add_library(${everest_target}
|
2021-03-25 17:03:25 +01:00
|
|
|
library/everest.c
|
|
|
|
library/x25519.c
|
|
|
|
library/Hacl_Curve25519_joined.c)
|
2019-01-07 15:12:25 +01:00
|
|
|
|
2023-09-28 18:52:52 +02:00
|
|
|
target_include_directories(${everest_target}
|
2021-03-25 17:03:25 +01:00
|
|
|
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/)
|
2019-02-22 18:02:12 +01:00
|
|
|
|
2023-10-02 11:46:59 +02:00
|
|
|
# Pass-through MBEDTLS_CONFIG_FILE and MBEDTLS_USER_CONFIG_FILE
|
|
|
|
# This must be duplicated from library/CMakeLists.txt because
|
|
|
|
# everest is not directly linked against any mbedtls targets
|
|
|
|
# so does not inherit the compile definitions.
|
|
|
|
if(MBEDTLS_CONFIG_FILE)
|
2023-10-06 12:48:44 +02:00
|
|
|
target_compile_definitions(${everest_target}
|
2023-10-02 11:46:59 +02:00
|
|
|
PUBLIC MBEDTLS_CONFIG_FILE="${MBEDTLS_CONFIG_FILE}")
|
|
|
|
endif()
|
|
|
|
if(MBEDTLS_USER_CONFIG_FILE)
|
2023-10-06 12:48:44 +02:00
|
|
|
target_compile_definitions(${everest_target}
|
2023-10-02 11:46:59 +02:00
|
|
|
PUBLIC MBEDTLS_USER_CONFIG_FILE="${MBEDTLS_USER_CONFIG_FILE}")
|
|
|
|
endif()
|
|
|
|
|
2020-05-25 09:39:09 +02:00
|
|
|
if(INSTALL_MBEDTLS_HEADERS)
|
2019-01-07 15:12:25 +01:00
|
|
|
|
2020-05-25 09:39:09 +02:00
|
|
|
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")
|
2019-01-21 18:26:19 +01:00
|
|
|
|
2020-05-25 09:39:09 +02:00
|
|
|
endif(INSTALL_MBEDTLS_HEADERS)
|
2019-01-21 18:26:19 +01:00
|
|
|
|
2023-09-28 18:52:52 +02:00
|
|
|
install(TARGETS ${everest_target}
|
2021-03-25 17:03:25 +01:00
|
|
|
EXPORT MbedTLSTargets
|
2022-04-22 17:26:21 +02:00
|
|
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
2021-03-25 17:03:25 +01:00
|
|
|
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
|