From 59f4fff30f4ab628da9aa7e5f77a7f1bb218a779 Mon Sep 17 00:00:00 2001 From: Alex Reinking Date: Tue, 14 Jan 2025 18:08:52 -0800 Subject: [PATCH] Don't include CMAKE_INSTALL_PREFIX when LIBDIR is absolute (#8552) --- cmake/HalidePackageConfigHelpers.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/HalidePackageConfigHelpers.cmake b/cmake/HalidePackageConfigHelpers.cmake index efdacba24a1f..2036c819b7d1 100644 --- a/cmake/HalidePackageConfigHelpers.cmake +++ b/cmake/HalidePackageConfigHelpers.cmake @@ -78,9 +78,10 @@ function(_Halide_install_pkgdeps) ) set(depFile "${CMAKE_CURRENT_BINARY_DIR}/${ARG_FILE_NAME}") + set(installPrefix "$<$:\${CMAKE_INSTALL_PREFIX}/>") _Halide_install_code( - "file(READ \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${ARG_DESTINATION}/${ARG_EXPORT_FILE}\" target_cmake)" + "file(READ \"\$ENV{DESTDIR}${installPrefix}${ARG_DESTINATION}/${ARG_EXPORT_FILE}\" target_cmake)" "file(WRITE \"${depFile}.in\" \"\")" )