1option(INSTALL_MBEDTLS_HEADERS "Install mbed TLS headers." ON)
2
3if(INSTALL_MBEDTLS_HEADERS)
4
5    file(GLOB headers "mbedtls/*.h")
6    file(GLOB psa_headers "psa/*.h")
7
8    install(FILES ${headers}
9        DESTINATION include/mbedtls
10        PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
11
12    install(FILES ${psa_headers}
13        DESTINATION include/psa
14        PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
15
16endif(INSTALL_MBEDTLS_HEADERS)
17
18# Make mbedtls_config.h available in an out-of-source build. ssl-opt.sh requires it.
19if (ENABLE_TESTING AND NOT ${CMAKE_CURRENT_BINARY_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
20    link_to_source(mbedtls)
21    link_to_source(psa)
22endif()
23