mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-10-15 17:26:45 +03:00
cmake: Install libmbedcrypto.* libraries
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
This commit is contained in:
@@ -267,6 +267,10 @@ foreach(target IN LISTS tf_psa_crypto_library_targets)
|
||||
$<TARGET_FILE:${target}>
|
||||
"libmbedcrypto.a"
|
||||
)
|
||||
install(FILES $<TARGET_FILE:${target}>
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RENAME "libmbedcrypto.a"
|
||||
)
|
||||
else()
|
||||
# Copy the crypto shared library from tf-psa-crypto:
|
||||
# - ".so.<VERSION>" on Unix
|
||||
@@ -296,7 +300,11 @@ foreach(target IN LISTS tf_psa_crypto_library_targets)
|
||||
COMMAND ${CMAKE_COMMAND} -E create_symlink
|
||||
$<TARGET_FILE_NAME:${target}>
|
||||
libmbedcrypto.dylib
|
||||
)
|
||||
)
|
||||
install(FILES $<TARGET_FILE:${target}>
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RENAME "libmbedcrypto.dylib"
|
||||
)
|
||||
elseif(WIN32 AND NOT CYGWIN)
|
||||
add_custom_command(
|
||||
TARGET ${mbedtls_target} POST_BUILD
|
||||
@@ -313,6 +321,14 @@ foreach(target IN LISTS tf_psa_crypto_library_targets)
|
||||
$<TARGET_LINKER_FILE:${target}>
|
||||
libmbedcrypto.lib
|
||||
)
|
||||
install(FILES $<TARGET_FILE:${target}>
|
||||
DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
RENAME "libmbedcrypto.dll"
|
||||
)
|
||||
install(FILES $<TARGET_LINKER_FILE:${target}>
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RENAME "libmbedcrypto.lib"
|
||||
)
|
||||
else()
|
||||
add_custom_command(
|
||||
TARGET ${mbedtls_target} POST_BUILD
|
||||
@@ -332,6 +348,20 @@ foreach(target IN LISTS tf_psa_crypto_library_targets)
|
||||
libmbedcrypto.so.${MBEDTLS_CRYPTO_SOVERSION}
|
||||
libmbedcrypto.so
|
||||
)
|
||||
install(FILES $<TARGET_FILE:${target}>
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RENAME "libmbedcrypto.so.${MBEDTLS_VERSION}"
|
||||
)
|
||||
install(CODE "
|
||||
set(_libdir \"\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}\")
|
||||
|
||||
execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E create_symlink
|
||||
\"libmbedcrypto.so.${MBEDTLS_VERSION}\"
|
||||
\${_libdir}/libmbedcrypto.so.${MBEDTLS_CRYPTO_SOVERSION})
|
||||
execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E create_symlink
|
||||
\"libmbedcrypto.so.${MBEDTLS_CRYPTO_SOVERSION}\"
|
||||
\${_libdir}/libmbedcrypto.so)
|
||||
")
|
||||
endif()
|
||||
endif()
|
||||
endforeach(target)
|
||||
|
@@ -17,6 +17,7 @@ execute_process(
|
||||
"-DENABLE_TESTING=NO"
|
||||
# Turn on generated files explicitly in case this is a release
|
||||
"-DGEN_FILES=ON"
|
||||
"-DUSE_SHARED_MBEDTLS_LIBRARY=ON"
|
||||
"-DCMAKE_INSTALL_PREFIX=${MbedTLS_INSTALL_DIR}")
|
||||
|
||||
execute_process(
|
||||
|
@@ -138,6 +138,16 @@ component_test_cmake_as_package_install () {
|
||||
cd programs/test/cmake_package_install
|
||||
cmake .
|
||||
make
|
||||
|
||||
if ! cmp -s "mbedtls/lib/libtfpsacrypto.a" "mbedtls/lib/libmbedcrypto.a"; then
|
||||
echo "Error: Crypto static libraries are different or one of them is missing/unreadable." >&2
|
||||
exit 1
|
||||
fi
|
||||
if ! cmp -s "mbedtls/lib/libtfpsacrypto.so" "mbedtls/lib/libmbedcrypto.so"; then
|
||||
echo "Error: Crypto shared libraries are different or one of them is missing/unreadable." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
./cmake_package_install
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user