mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-22 05:05:11 +00:00
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 <henryschreineriii@gmail.com>
This commit is contained in:
parent
0b9acc4009
commit
c513b5e3c6
@ -226,12 +226,12 @@ find_package(Boost 1.56)
|
||||
|
||||
if(Boost_FOUND)
|
||||
if(NOT TARGET Boost::headers)
|
||||
add_library(Boost::headers IMPORTED INTERFACE)
|
||||
if(TARGET Boost::boost)
|
||||
# Classic FindBoost
|
||||
add_library(Boost::headers ALIAS Boost::boost)
|
||||
set_property(TARGET Boost::boost PROPERTY INTERFACE_LINK_LIBRARIES Boost::boost)
|
||||
else()
|
||||
# Very old FindBoost, or newer Boost than CMake in older CMakes
|
||||
add_library(Boost::headers IMPORTED INTERFACE)
|
||||
set_property(TARGET Boost::headers PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
||||
${Boost_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
Loading…
Reference in New Issue
Block a user