From 6232deaae33169103d933da266fe796f85c282fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dylan=20A=C3=AFssi?= Date: Mon, 16 Feb 2026 10:05:20 +0100 Subject: [PATCH] CMake: Use HIPIFY_OUTPUT_DIR when installing ROCm headers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When USE_ROCM is enabled, the install path for HIP headers was derived by replacing CMAKE_CURRENT_SOURCE_DIR in the header directory path. However, HIPified headers are generated into HIPIFY_OUTPUT_DIR, not CMAKE_CURRENT_SOURCE_DIR. As a result, the computed install path is incorrect. This change replaces CMAKE_CURRENT_SOURCE_DIR with HIPIFY_OUTPUT_DIR when rewriting header paths, ensuring ROCm headers are installed into the correct include/gloo/... location. This fixes incorrect include directory layout when building with ROCm. Signed-off-by: Dylan Aïssi --- gloo/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gloo/CMakeLists.txt b/gloo/CMakeLists.txt index 10c1e4efc..87c990e0e 100644 --- a/gloo/CMakeLists.txt +++ b/gloo/CMakeLists.txt @@ -217,7 +217,7 @@ if(GLOO_INSTALL) if(USE_ROCM) foreach(HEADER ${GLOO_HIP_HDRS}) string(REGEX MATCH "(.*)[/\\]" DIR ${HEADER}) - string(REGEX REPLACE "${CMAKE_CURRENT_SOURCE_DIR}" "gloo" DIR ${DIR}) + string(REGEX REPLACE "${HIPIFY_OUTPUT_DIR}" "gloo" DIR ${DIR}) install(FILES ${HEADER} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/${DIR}) endforeach() endif()