#!/usr/bin/env bash # Generate the Boost CMake config files OSRM's find_package(Boost CONFIG) # needs, pointing at a b2-built boost (headers in $P/include/boost, # static libs in $P/lib). Boost release tarballs ship no CMake support, # so we roll minimal configs: one per component + version + main. # # W=/tmp/osm-build bash install-boost-cmake.sh set -euo pipefail W="${W:-/tmp/osm-build}" P="$W/prefix" CM="$P/lib/cmake/Boost-1.84.0" mkdir -p "$CM" cat > "$CM/BoostConfigVersion.cmake" <<'EOF' set(PACKAGE_VERSION "1.84.0") if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) set(PACKAGE_VERSION_COMPATIBLE FALSE) else() set(PACKAGE_VERSION_COMPATIBLE TRUE) if(PACKAGE_VERSION VERSION_EQUAL PACKAGE_FIND_VERSION) set(PACKAGE_VERSION_EXACT TRUE) endif() endif() EOF # component: cmlist-name b2-lib-name for pair in "date_time date_time" "iostreams iostreams" \ "program_options program_options" "thread thread" \ "unit_test_framework test" "regex regex" "zlib zlib"; do comp=${pair% *} b2name=${pair#* } cap=$(echo "$comp" | tr 'a-z' 'A-Z') if [ "$comp" = "zlib" ]; then # OSRM lists Boost_ZLIB_LIBRARY in BOOST_ENGINE_LIBRARIES; use system zlib cat > "$CM/Boost${cap}Config.cmake" </dev/null | head -1 || true) if [ -z "$lib" ]; then echo "FATAL: no static lib for $comp (b2name $b2name)" >&2 exit 1 fi cat > "$CM/Boost${cap}Config.cmake" < "$CM/BoostConfig.cmake" <