FindBoost skips remaining prefix paths on first version mismatch
In my CMake config I have added multiple directories to CMAKE_PREFIX_PATH
. Each contains one package (like Boost or GMP) in a specific version. Some packages are available in different versions. Like this:
- .../libs/boost-1.50.0
- .../libs/boost-1.59.0
- .../libs/gmp-6.0.0
The CMAKE_PREFIX_PATH
looks like this:
.../libs/boost-1.50.0;.../libs/boost-1.59.0;.../libs/gmp-6.0.0
One of my projects using this CMAKE_PREFIX_PATH
requires Boost 1.59.0, but CMake stops with an error just after the version-check in .../libs/boost-1.50.0
has occurred.
CMake Error at ../libs/cmake-3.6.1/share/cmake-3.6/Modules/FindBoost.cmake:1753 (message):
Unable to find the requested Boost libraries.
Boost version: 1.50.0
Boost include path: .../libs/boost-1.50.0/include
Detected version of Boost is too old. Requested version was 1.59.
Call Stack (most recent call first):
code/mymodule/CMakeLists.txt:2 (find_package)
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Configuring incomplete, errors occurred!
The following prefix, which contains the required version, is not even checked.
My current CMake version is 3.6.1
.