From ffc2606bf26ecca1149b47be0969263adb0d3654 Mon Sep 17 00:00:00 2001 From: Luc Schrijvers Date: Thu, 23 Oct 2025 08:17:08 +0200 Subject: [PATCH] Use GNUInstallDirs CMAKE_INSTALL_INCLUDEDDIR path for headers installation Signed-off-by: Luc Schrijvers --- ChangeLog.d/gnuinstalldirs_include.txt | 3 +++ include/CMakeLists.txt | 4 ++-- library/CMakeLists.txt | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 ChangeLog.d/gnuinstalldirs_include.txt diff --git a/ChangeLog.d/gnuinstalldirs_include.txt b/ChangeLog.d/gnuinstalldirs_include.txt new file mode 100644 index 0000000000..7e0782d1e1 --- /dev/null +++ b/ChangeLog.d/gnuinstalldirs_include.txt @@ -0,0 +1,3 @@ +Bugfix + * CMake now installs headers to `CMAKE_INSTALL_INCLUDEDIR` instead of the + hard-coded `include` directory. diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index 9ea17af8b8..f76977fbab 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -5,13 +5,13 @@ if(INSTALL_MBEDTLS_HEADERS) file(GLOB headers "mbedtls/*.h") install(FILES ${headers} - DESTINATION include/mbedtls + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mbedtls PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) file(GLOB private_headers "mbedtls/private/*.h") install(FILES ${private_headers} - DESTINATION include/mbedtls/private + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mbedtls/private PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) endif(INSTALL_MBEDTLS_HEADERS) diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index 6d8c78807a..5474e2cacf 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -241,7 +241,7 @@ foreach(target IN LISTS target_libraries) PUBLIC $ $ $ - $ + $ PRIVATE ${MBEDTLS_DIR}/library/ ${MBEDTLS_DIR}/tf-psa-crypto/core ${MBEDTLS_DIR}/tf-psa-crypto/drivers/builtin/src