FindBoost fails to find boost by more boost versions
Here is how to reproduce this bug: Two boost are installed in a Folder, e.g.,:
/some/dir/soft/boost_1_75_0_py2.7
-
/some/dir/soft/boost_1_75_0_py3.8
and by settingBOOST_DIR
to for example/some/dir/soft/boost_1_75_0_py3.8
, findboost finds the wrong one (In my caseboost_1_75_0_py2.7
). Attached are two files for reproducing this bug. CMakeLists.txt helloworld.cpp
Hier is the output of console:
[me@mypc]:[/var/tmp/boostbug]>mkdir build
[me@mypc]:[/var/tmp/boostbug]>cd build/
[me@mypc]:[/var/tmp/boostbug/build]>echo $BOOST_DIR
/some/dir/soft/boost_1_75_0_py3.8
[me@mypc]:[/var/tmp/boostbug/build]>echo $BOOST_ROOT
/some/dir/soft/boost_1_75_0_py3.8
[me@mypc]:[/var/tmp/boostbug/build]>rm -rf *; cmake ..
-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Deprecation Warning at CMakeLists.txt:2 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
-- Found Boost: /some/dir/soft/boost_1_75_0_py2.7/lib/cmake/Boost-1.75.0/BoostConfig.cmake (found version "1.75.0") found components: thread regex date_time
-- Boost found: Boost::thread;Boost::regex;Boost::date_time
-- Configuring done
-- Generating done
-- Build files have been written to: /var/tmp/boostbug/build