investigated under https://gitlab.kitware.com/cmake/cmake/-/issues/23881 Index: cmake-3.26.2/Modules/GetPrerequisites.cmake =================================================================== --- cmake-3.26.2.orig/Modules/GetPrerequisites.cmake +++ cmake-3.26.2/Modules/GetPrerequisites.cmake @@ -730,9 +730,9 @@ function(get_prerequisites target prereq if(gp_tool MATCHES "ldd$") set(gp_cmd_args "") - set(gp_regex "^[\t ]*[^\t ]+ =>[\t ]+([^\t\(]+)( \(.+\))?${eol_char}$") + set(gp_regex "^[\t ]*[^\t ]+ =>[\t ]+(/[^\t\(]+)( \(.+\))?${eol_char}$") set(gp_regex_error "not found${eol_char}$") - set(gp_regex_fallback "^[\t ]*([^\t ]+) => ([^\t ]+).*${eol_char}$") + set(gp_regex_fallback "^[\t ]*([^\t ]+) => (/[^\t ]+).*${eol_char}$") set(gp_regex_cmp_count 1) elseif(gp_tool MATCHES "otool$") set(gp_cmd_args "-L")