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\" \"\")" )