From b04de3090f25506c00a1f159dc5d9b211dc839fe Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Fri, 16 Sep 2022 03:56:32 -0600 Subject: [PATCH] Lagom: Skip IMPORTED targets in get_linked_lagom_libraries This script is useful when wanting to install lagom libraries for projects using Lagom via FetchContent, but trips over itself if the project links other non-Lagom imported targets to itself. So, let's just skip them. --- Meta/Lagom/get_linked_lagom_libraries.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Meta/Lagom/get_linked_lagom_libraries.cmake b/Meta/Lagom/get_linked_lagom_libraries.cmake index a77928bbfb8..1f5a1d3000e 100644 --- a/Meta/Lagom/get_linked_lagom_libraries.cmake +++ b/Meta/Lagom/get_linked_lagom_libraries.cmake @@ -11,6 +11,11 @@ function(get_linked_lagom_libraries_impl target output) return() endif() + get_target_property(target_is_imported "${target}" IMPORTED) + if (target_is_imported) + return() + endif() + get_target_property(target_type "${target}" TYPE) if ("${target_type}" STREQUAL "SHARED_LIBRARY")