Skip to content

Commit 4b50749

Browse files
committed
fix cmake test
1 parent 3632b00 commit 4b50749

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

test/cmake_test/CMakeLists.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,15 @@ set(__ignore__ ${CMAKE_C_COMPILER})
1212
set(__ignore__ ${CMAKE_C_FLAGS})
1313

1414
if(BOOST_CI_INSTALL_TEST)
15-
# Boost as a package (https://github.com/boostorg/cmake#using-boost-after-building-and-installing-it-with-cmake)
16-
find_package(Boost CONFIG REQUIRED COMPONENTS openmethod)
15+
# Header-only libraries:
16+
# B2 does not (yet) create/install CMake targets for them, so users are supposed to use the generic Boost::headers target
17+
if(BOOST_CI_INSTALLED_BY STREQUAL "B2")
18+
find_package(Boost REQUIRED)
19+
add_library(Boost::openmethod ALIAS Boost::headers)
20+
else()
21+
# Boost as a package (https://github.com/boostorg/cmake#using-boost-after-building-and-installing-it-with-cmake)
22+
find_package(Boost CONFIG REQUIRED COMPONENTS openmethod)
23+
endif()
1724
elseif(BOOST_CI_INSTALL_MODULE_TEST)
1825
# Boost.OpenMethod as a package
1926
find_package(boost_openmethod CONFIG REQUIRED)

0 commit comments

Comments
 (0)