Incorrect Boost::headers.INTERFACE_INCLUDE_DIRECTORIES
Anthony Mallet <[email protected]>
| Newsgroups | gmane.os.netbsd.devel.packages |
|---|---|
| Organization | LAAS/CNRS - Toulouse - France |
| Message-ID | <[email protected]> |
Hi,
I'm facing the issue reported in https://github.com/NetBSD/pkgsrc/issues/167
Any external (not pkgsrc) project using the boost/cmake config file
will get the boost header path wrong.
The installed cmake file in
/usr/pkg/lib/cmake/boost_headers-1.89.0/boost_headers-config.cmake
from boost-headers-1.89.0nb1 (pkgsrc-2025Q4) is incorrect.
More precisely, the following bits of code in the above file do resolve to
"/usr" for INTERFACE_INCLUDE_DIRECTORIES, which is wrong:
get_filename_component(_BOOST_CMAKEDIR "${CMAKE_CURRENT_LIST_DIR}/../" REALPATH)
get_filename_component(_BOOST_INCLUDEDIR "${_BOOST_CMAKEDIR}/../../../" ABSOLUTE)
set_target_properties(Boost::headers PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${_BOOST_INCLUDEDIR}"
)
Replacing the definition of _BOOST_INCLUDEDIR with
"${_BOOST_CMAKEDIR}/../../include/" gives the correct behaviour.
Maybe this could simply be patched locally by pkgsrc until someone
figures out what's wrong with this file?
(I tried to look at boost-build sources but it's a bit too much
obfuscated to really figure out what's going on ...)