Skip to content

Commit

Permalink
fix(boost): do not link to ALIAS target (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
FrogTheFrog authored Dec 17, 2024
1 parent bbcd179 commit bc7ea1f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmake/Boost_DD.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@ else()
# (differ in linked targets).
# Also, FetchContent creates Boost::<lib> targets, whereas find_package does not. Since we cannot extend
# Boost::headers as it is an ALIAS target, this is the workaround:
get_target_property(ORIGINAL_TARGET Boost::headers ALIASED_TARGET)
if (ORIGINAL_TARGET STREQUAL "ORIGINAL_TARGET-NOTFOUND")
set(ORIGINAL_TARGET Boost::headers)
endif ()
foreach (lib ${REQUIRED_HEADER_LIBRARIES})
if (NOT TARGET Boost::${lib})
add_library(Boost::${lib} ALIAS Boost::headers)
add_library(Boost::${lib} ALIAS ${ORIGINAL_TARGET})
endif ()
endforeach ()
endif()

0 comments on commit bc7ea1f

Please sign in to comment.