From 767596ed38633f27d037222b7ebbacdfc91e40ef Mon Sep 17 00:00:00 2001 From: crueter Date: Tue, 26 Aug 2025 20:53:46 -0400 Subject: [PATCH] [cmake] fix hash fetch Signed-off-by: crueter --- CMakeModules/CPMUtil.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeModules/CPMUtil.cmake b/CMakeModules/CPMUtil.cmake index f460a8df94..33c07c59b6 100644 --- a/CMakeModules/CPMUtil.cmake +++ b/CMakeModules/CPMUtil.cmake @@ -375,9 +375,13 @@ function(AddPackage) file(DOWNLOAD ${hash_url} ${outfile}) endif() - file(READ ${outfile} pkg_hash_tmp) + if (EXISTS ${outfile}) + file(READ ${outfile} pkg_hash_tmp) + endif() - set(pkg_hash "${hash_algo}=${pkg_hash_tmp}") + if (DEFINED ${pkg_hash_tmp}) + set(pkg_hash "${hash_algo}=${pkg_hash_tmp}") + endif() endif() # TODO(crueter): force system/bundled for specific packages via options e.g httplib_SYSTEM