# Boost minimum version isn't?

**URL:** https://discourse.cmake.org/t/boost-minimum-version-isnt/4055
**Category:** Usage
**Created:** [September 8, 2021, 4:51pm UTC](https://discourse.cmake.org/t/boost-minimum-version-isnt/4055 "2021-09-08T16:51:43Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![jwm](https://discourse.cmake.org/user_avatar/discourse.cmake.org/jwm/32/654_2.png) [@jwm](https://discourse.cmake.org/u/jwm)
#### Post date: [September 8, 2021, 4:51pm UTC](https://discourse.cmake.org/t/boost-minimum-version-isnt/4055/1 "2021-09-08T16:51:43Z")

</div>

I’m trying to build GNU Radio (master). It has a minimum Boost version of 1.65 [asserted](https://github.com/gnuradio/gnuradio/blob/master/CMakeLists.txt#L60). However, it appears that their custom CMake module is unintentionally allowing older Boost versions.

(I’ve looked at [Best practices to set imported package settings](https://discourse.cmake.org/t/best-practices-to-set-imported-package-settings/3053) and [Fail to use self build Boost 1.75 under Ubuntu Linux 20.04 x64 with CMake default and 3.19.4](https://discourse.cmake.org/t/fail-to-use-self-build-boost-1-75-under-ubuntu-linux-20-04-x64-with-cmake-default-and-3-19-4/2750) but they don’t seem to explain what’s happening).

In particular, I’d like to understand what this [block of code](https://github.com/gnuradio/gnuradio/blob/4c6ae3a386ec19698a8c01144c4e8a52fc113404/cmake/Modules/GrBoost.cmake#L63) does:

```cmake
set(Boost_ADDITIONAL_VERSIONS
    "1.53" "1.54.0" "1.54"
    "1.55.0" "1.55" "1.56.0" "1.56" "1.57.0" "1.57" "1.58.0" "1.58" "1.59.0" "1.59"
    "1.60.0" "1.60" "1.61.0" "1.61" "1.62.0" "1.62" "1.63.0" "1.63" "1.64.0" "1.64"
    "1.65.0" "1.65" "1.66.0" "1.66" "1.67.0" "1.67" "1.68.0" "1.68" "1.69.0" "1.69"
    "1.71.0" "1.71"
)

find_package(Boost ${GR_BOOST_MIN_VERSION} REQUIRED ${BOOST_REQUIRED_COMPONENTS}
                                           OPTIONAL_COMPONENTS unit_test_framework)

```

It looks like I was able to get through the configure step and use my Boost 1.53 installation, which resulted in compilation failure.

Is the right answer to remove the older versions from `Boost_ADDITIONAL_VERSIONS` or is there something else at play here that I don’t understand?

---

<div class="post-metadata">

### Author: ![McMartin](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mcmartin/32/150_2.png) [@McMartin](https://discourse.cmake.org/u/McMartin)
#### Post date: [September 8, 2021, 8:35pm UTC](https://discourse.cmake.org/t/boost-minimum-version-isnt/4055/2 "2021-09-08T20:35:05Z")

</div>

AFAICS, the issue is that `GrBoost.cmake` is included _before_ setting `GR_BOOST_MIN_VERSION`, so the value of `GR_BOOST_MIN_VERSION` doesn’t have an impact on the behavior of the `find_package(Boost ...)` call in `GrBoost.cmake`.

> <https://github.com/gnuradio/gnuradio/blob/4c6ae3a386ec19698a8c01144c4e8a52fc113404/CMakeLists.txt#L48-L60>

---

<div class="post-metadata">

### Author: ![jwm](https://discourse.cmake.org/user_avatar/discourse.cmake.org/jwm/32/654_2.png) [@jwm](https://discourse.cmake.org/u/jwm)
#### Post date: [September 8, 2021, 9:08pm UTC](https://discourse.cmake.org/t/boost-minimum-version-isnt/4055/3 "2021-09-08T21:08:58Z")

</div>

Thank you. If I move the `include(GrBoost)` after line 60, it fails as expected with the older Boost

---

<div class="post-metadata">

### Author: ![ClausKlein](https://discourse.cmake.org/user_avatar/discourse.cmake.org/clausklein/32/352_2.png) [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)
#### Post date: [September 10, 2021, 6:02am UTC](https://discourse.cmake.org/t/boost-minimum-version-isnt/4055/4 "2021-09-10T06:02:34Z")

</div>

Interesting **mixed cases in cmake commands**?

How long will cmake work with this?
