From 5611af8c84b1a41dec1fb2672f291c3fd9e2c352 Mon Sep 17 00:00:00 2001 From: Chris Green Date: Thu, 11 Jan 2024 15:14:58 -0600 Subject: [PATCH] Main a unique list of dependencies by project name --- Modules/private/CetAddTransitiveDependency.cmake | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Modules/private/CetAddTransitiveDependency.cmake b/Modules/private/CetAddTransitiveDependency.cmake index db670f72..fbc1bd60 100644 --- a/Modules/private/CetAddTransitiveDependency.cmake +++ b/Modules/private/CetAddTransitiveDependency.cmake @@ -20,6 +20,18 @@ function(_cet_add_transitive_dependency SOURCE_CALL FIRST_ARG) set(cache_var CETMODULES_FIND_DEPS_PROJECT_${CETMODULES_CURRENT_PROJECT_NAME}) unset(docstring_extra) endif() + if (NOT DEFINED CACHE{CETMODULES_FIND_DEPS_PNAMES_PROJECT_${CETMODULES_CURRENT_PROJECT_NAME}}) + set(CETMODULES_FIND_DEPS_PNAMES_PROJECT_${CETMODULES_CURRENT_PROJECT_NAME} + "${DEP}" CACHE INTERNAL + "Transitive dependency project names for ${CETMODULES_CURRENT_PROJECT_NAME}") + else() + get_property(tdeps CACHE CETMODULES_FIND_DEPS_PNAMES_PROJECT_${CETMODULES_CURRENT_PROJECT_NAME} + PROPERTY VALUE) + list(APPEND tdeps "${DEP}") + list(REMOVE_DUPLICATES tdeps) + set_property(CACHE CETMODULES_FIND_DEPS_PNAMES_PROJECT_${CETMODULES_CURRENT_PROJECT_NAME} + PROPERTY VALUE "${tdeps}") + endif() # Set up the beginning of the call. string(TOLOWER "${SOURCE_CALL}" TRANSITIVE_CALL) if (TRANSITIVE_CALL STREQUAL "find_package")