Skip to content

Commit 5a5ddbd

Browse files
committed
build: Add workaround for NetBSD bug in Boost::headers target
Due to a bug in `boost_headers-config.cmake`, the `Boost::headers` target's `INTERFACE_INCLUDE_DIRECTORIES` property is set to "/usr", which is incorrect.
1 parent 4eb3cee commit 5a5ddbd

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

cmake/module/AddBoostIfNeeded.cmake

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ function(add_boost_if_needed)
3131

3232
find_package(Boost 1.73.0 REQUIRED CONFIG)
3333
mark_as_advanced(Boost_INCLUDE_DIR boost_headers_DIR)
34+
# Workaround for a bug in NetBSD pkgsrc.
35+
# See: https://github.com/NetBSD/pkgsrc/issues/167.
36+
if(CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
37+
get_filename_component(_boost_include_dir "${boost_headers_DIR}/../../../include/" ABSOLUTE)
38+
set_target_properties(Boost::headers PROPERTIES
39+
INTERFACE_INCLUDE_DIRECTORIES ${_boost_include_dir}
40+
)
41+
unset(_boost_include_dir)
42+
endif()
3443
set_target_properties(Boost::headers PROPERTIES IMPORTED_GLOBAL TRUE)
3544
target_compile_definitions(Boost::headers INTERFACE
3645
# We don't use multi_index serialization.

0 commit comments

Comments
 (0)