Skip to content

Commit

Permalink
prepare-cpp_stl: make Boost 1.76 also findable by CMake
Browse files Browse the repository at this point in the history
For the record, here's what the message from `cmake` looked like without
the `BOOST_ROOT` environment variable set:

```
CMake Warning (dev) at CMakeLists.txt:7 (find_package):
  Policy CMP0167 is not set: The FindBoost module is removed.  Run "cmake
  --help-policy CMP0167" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at /usr/local/Cellar/cmake/3.30.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
  Could NOT find Boost (missing: Boost_INCLUDE_DIR unit_test_framework)
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.30.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
  /usr/local/Cellar/cmake/3.30.0/share/cmake/Modules/FindBoost.cmake:2409 (find_package_handle_standard_args)
  CMakeLists.txt:7 (find_package)
```
  • Loading branch information
generalmimon committed Jul 14, 2024
1 parent 4566111 commit bd5f309
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions prepare-cpp_stl
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ if [ -n "$GITHUB_ACTIONS" ] && [ "$RUNNER_OS" = macOS ]; then
# export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
# export CPPFLAGS="-I/usr/local/opt/[email protected]/include"
# ```
echo LDFLAGS="-L/usr/local/opt/[email protected]/lib" >> "$GITHUB_ENV"
echo CPPFLAGS="-I/usr/local/opt/[email protected]/include" >> "$GITHUB_ENV"
boost_prefix=$(brew --prefix [email protected])
echo LDFLAGS="-L${boost_prefix}/lib" >> "$GITHUB_ENV"
echo CPPFLAGS="-I${boost_prefix}/include" >> "$GITHUB_ENV"
# the `BOOST_ROOT` environment variable is required for CMake to find Boost
echo BOOST_ROOT="${boost_prefix}" >> "$GITHUB_ENV"
fi

0 comments on commit bd5f309

Please sign in to comment.