From 2a9c8b62bffe43c21619f31d46c6fcf7d272462d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Wed, 28 Jan 2015 14:42:13 +0100 Subject: [PATCH] Add cmake compatibility targets --- library/CMakeLists.txt | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index f738b3b2e2..ed4a10e027 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -133,3 +133,24 @@ if(USE_SHARED_MBEDTLS_LIBRARY) DESTINATION ${LIB_INSTALL_DIR} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) endif(USE_SHARED_MBEDTLS_LIBRARY) + +if(UNIX) + add_custom_target(polarssl + DEPENDS mbedtls # TODO: and mbedtls_static is shared is defined + COMMAND ${CMAKE_SOURCE_DIR}/scripts/polarssl_symlinks.sh ${CMAKE_BINARY_DIR}/library + ) + + if(USE_STATIC_MBEDTLS_LIBRARY AND USE_SHARED_MBEDTLS_LIBRARY) + add_dependencies(polarssl mbedtls_static) + endif() + + add_custom_target(polarssl-clean + COMMAND make clean + COMMAND rm -f ${CMAKE_BINARY_DIR}/library/libpolarssl.* + ) + + add_custom_target(polarssl-install + COMMAND make install + COMMAND ${CMAKE_SOURCE_DIR}/scripts/polarssl_symlinks.sh ${DESTDIR}/${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR} + ) +endif(UNIX)