summaryrefslogtreecommitdiffstats
path: root/Modules/GetPrerequisites.cmake
diff options
context:
space:
mode:
authorGuillaume Dumont <dumont.guillaume@gmail.com>2017-05-04 18:51:39 (GMT)
committerBrad King <brad.king@kitware.com>2017-05-11 20:12:38 (GMT)
commite0e414d6593d952facb2ce2364d17b34afac8760 (patch)
tree3512b1b45ef03b06c3a54c09a75f28649b38395a /Modules/GetPrerequisites.cmake
parent8e2f3582eb9cf75c78fbe8232cdacce2357f7efc (diff)
downloadCMake-e0e414d6593d952facb2ce2364d17b34afac8760.zip
CMake-e0e414d6593d952facb2ce2364d17b34afac8760.tar.gz
CMake-e0e414d6593d952facb2ce2364d17b34afac8760.tar.bz2
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.
Diffstat (limited to 'Modules/GetPrerequisites.cmake')
-rw-r--r--Modules/GetPrerequisites.cmake6
1 files changed, 5 insertions, 1 deletions
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()