Skip to content

Commit c513b5e

Browse files
tests(CMakeLists): robustify against add'l versions of Boost (#2608)
* tests/CMakeLists: Robustify against add'l versions of Boost * refactor: simpler impl Co-authored-by: Henry Schreiner <[email protected]>
1 parent 0b9acc4 commit c513b5e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,12 @@ find_package(Boost 1.56)
226226

227227
if(Boost_FOUND)
228228
if(NOT TARGET Boost::headers)
229+
add_library(Boost::headers IMPORTED INTERFACE)
229230
if(TARGET Boost::boost)
230231
# Classic FindBoost
231-
add_library(Boost::headers ALIAS Boost::boost)
232+
set_property(TARGET Boost::boost PROPERTY INTERFACE_LINK_LIBRARIES Boost::boost)
232233
else()
233234
# Very old FindBoost, or newer Boost than CMake in older CMakes
234-
add_library(Boost::headers IMPORTED INTERFACE)
235235
set_property(TARGET Boost::headers PROPERTY INTERFACE_INCLUDE_DIRECTORIES
236236
${Boost_INCLUDE_DIRS})
237237
endif()

0 commit comments

Comments
 (0)