Skip to contentSkip to conversation

boost: install CMake config for header-only system library

PATCH In review Siva Balasubramanian 2 participants 2 messages Jul 3

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 boost: install CMake config for header-only system library

In 1.91.0 (4981f3087a30) boost-system became a header-only "modular" library with no separate shared object, and was therefore dropped from BOOST_LIBS. As a side effect its CMake package config is no longer
installed: the top-level b2 install target only ships configs for the libraries selected via --with-<library>, and 'system' can no longer be named there (b2 errors out with "wrong library name 'system'").

Downstream software that does find_package(Boost COMPONENTS system) then fails to configure and has to be patched.

Install the modular 'libs/system//install' target explicitly from do_install so that lib/cmake/boost_system-<ver>/ is shipped again in the -dev package. The target is header-only, so no library is built or packaged; only the CMake config (and already-present headers) are added.

Verified with a from-scratch build: boost_system-config.cmake is packaged into boost-dev and find_package(Boost REQUIRED COMPONENTS system) succeeds against the installed tree again.

[YOCTO #16346]

---
 meta/recipes-support/boost/boost.inc | 11 +++++++++++
 1 file changed, 11 insertions(+)
meta/recipes-support/boost/boost.inc +11 -0
index 7a343e54f6..3cd71c4d6e 100644
@@ -203,6 +203,17 @@ do_install() {
 		--libdir=${D}${libdir} \
 		--includedir=${D}${includedir} \
 		install
+
+	# In 1.91 boost-system became a header-only "modular" library and is no
+	# longer selectable through --with-system, so it is not part of BOOST_LIBS
+	# and the top-level install target no longer ships its CMake package
+	# config. Install that modular target explicitly so downstream
+	# find_package(Boost COMPONENTS system) keeps working.
+	b2 ${BJAM_OPTS} \
+		--libdir=${D}${libdir} \
+		--includedir=${D}${includedir} \
+		libs/system//install
+
 	for lib in ${BOOST_LIBS}; do
 		if [ -e ${D}${libdir}/libboost_${lib}.a ]; then
 			ln -s libboost_${lib}.a ${D}${libdir}/libboost_${lib}-mt.a
Signature · 1 line
2.34.1
#1 lore raw

meta/recipes-support/boost/boost.inc do_install() { · line 215

Quoted 9 lines · Siva Balasubramanian via lists.openembedded.org
meta/recipes-support/boost/boost.inc +9 -0
+       # In 1.91 boost-system became a header-only "modular" library and is no
+       # longer selectable through --with-system, so it is not part of BOOST_LIBS
+       # and the top-level install target no longer ships its CMake package
+       # config. Install that modular target explicitly so downstream
+       # find_package(Boost COMPONENTS system) keeps working.
+       b2 ${BJAM_OPTS} \
+               --libdir=${D}${libdir} \
+               --includedir=${D}${includedir} \
+               libs/system//install

Apologies, but I do not think this is correct. If system is a header-only library, then the software that requests a cmake module for it needs to be fixed, rather than boost or its recipe. If b2 is not installing something by default, than that something is not meant to be installed, and isn't guaranteed to work or even exist.

Alex