From e0e414d6593d952facb2ce2364d17b34afac8760 Mon Sep 17 00:00:00 2001 From: Guillaume Dumont Date: Thu, 4 May 2017 14:51:39 -0400 Subject: GetPrerequisites: Only recurse on resolved unseen prerequisites I encountered an issue where not all prerequisites would be listed by `get_prerequisites` since some of the prerequisites cannot be resolved and are added to the list of unseen prerequisites. This has the side effect of clearing the list of `prerequisites_var` and thus removes some prerequisites from the list. Fix it. --- Modules/GetPrerequisites.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake index a3b97ab..0090cdc 100644 --- a/Modules/GetPrerequisites.cmake +++ b/Modules/GetPrerequisites.cmake @@ -943,7 +943,11 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa # if(NOT list_length_before_append EQUAL list_length_after_append) gp_resolve_item("${target}" "${item}" "${exepath}" "${dirs}" resolved_item "${rpaths}") - set(unseen_prereqs ${unseen_prereqs} "${resolved_item}") + if(EXISTS "${resolved_item}") + # Recurse only if we could resolve the item. + # Otherwise the prerequisites_var list will be cleared + set(unseen_prereqs ${unseen_prereqs} "${resolved_item}") + endif() endif() endif() endif() -- cgit v0.12