Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake/boost.cmake: fixes search path for (linked) boost package if build in sub-directory #332

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sebres
Copy link

@sebres sebres commented Oct 15, 2021

Rationales

If one try to build hyperscan in a sub-directory, and boost is linked to include, as it is described in Getting started, one may get an error that boost package is not found:

$ cd /path/to/hyperscan
$ ln -s /path/to/boost ./include/boost
$ mkdir build/Release_x64; cd build/Release_x64
$ cmake -S ../.. -B .
...
CMake Error at cmake/boost.cmake:23 (message):
  Boost 1.57.0 or later not found.  Either install system packages if
  available, extract Boost headers to /path/to/hyperscan/include, or
  set the CMake BOOST_ROOT variable.
...
-- Configuring incomplete, errors occurred!

Note: it seems to be affected only if one uses cmake not in project root directory... for instance like devs doing it often to hold Debug/Release/etc and platforms related (x64/x86) builds in different locations.

This PR proposes a fix for that - it would take a look into include/boost before include.

Toolchain and platform details

$ cmake --version
cmake version 3.20.1

$ grep 'Boost VERSION' ../../include/boost/CMakeLists.txt
project(Boost VERSION 1.78.0 LANGUAGES CXX)

$ bash --version
GNU bash, version 5.1.8(1)-release (x86_64-pc-msys)

$ systeminfo | grep 'OS '
OS Name:                   Microsoft Windows 10 Pro
OS Version:                10.0.19042 N/A Build 19042

…ild in sub-directory (take a look into `include/boost` before `include`);

otherwise `cd build/Release_x64; cmake -S ../.. -B .` may fail, because it cannot find linked boost folder.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant