From 1758fe3e4d1ebc907b51523c4566564e4a634cfd Mon Sep 17 00:00:00 2001 From: Lukas Senionis Date: Fri, 4 Oct 2024 23:13:25 +0300 Subject: [PATCH] fix(boost): do not create alias for existing targets --- cmake/Boost_DD.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/Boost_DD.cmake b/cmake/Boost_DD.cmake index b476665..07ac57e 100644 --- a/cmake/Boost_DD.cmake +++ b/cmake/Boost_DD.cmake @@ -31,6 +31,8 @@ else() # Also, FetchContent creates Boost:: targets, whereas find_package does not. Since we cannot extend # Boost::headers as it is an ALIAS target, this is the workaround: foreach (lib ${REQUIRED_HEADER_LIBRARIES}) - add_library(Boost::${lib} ALIAS Boost::headers) + if (NOT TARGET Boost::${lib}) + add_library(Boost::${lib} ALIAS Boost::headers) + endif () endforeach () endif()