1cmake_minimum_required(VERSION 2.6) 2 3# Test the target renaming support by adding a prefix to the targets built 4set(MBEDTLS_TARGET_PREFIX subproject_test_) 5 6# We use the parent Mbed TLS directory as the MBEDTLS_DIR for this test. Other 7# projects that use Mbed TLS as a subproject are likely to add by their own 8# relative paths. 9set(MBEDTLS_DIR ../../../) 10 11# Add Mbed TLS as a subdirectory. 12add_subdirectory(${MBEDTLS_DIR} build) 13 14# Link against all the Mbed TLS libraries. Verifies that the targets have been 15# created using the specified prefix 16set(libs 17 subproject_test_mbedcrypto 18 subproject_test_mbedx509 19 subproject_test_mbedtls 20) 21 22add_executable(cmake_subproject cmake_subproject.c) 23target_link_libraries(cmake_subproject ${libs}) 24