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()