Open jongbongan opened 1 month ago
Thanks for posting! It might take a while before we look at your issue, so don't worry if there seems to be no feedback. We'll get to it.
I think we should use the config based find_package when the CMake version >= 3.30 and FindBoost when < 3.30. If users can use the newest versions of CMake then they can probably upgrade to the newest versions of boost as well.
Because boost supports its cmake configuration for version >= 1.70, I will add a config argument in find_package(boost ... ) as soon as the minimum required version of boost changes to >= 1.70.
(now, {QL_BOOST_VERSION} would be 1.58.0)
I was thinking more like the following:
if (CMAKE_VERSION GREATER_EQUAL "3.30")
set(QL_BOOST_VERSION 1.70.0)
find_package(Boost ${QL_BOOST_VERSION} CONFIG REQUIRED)
else()
find_package(Boost ${QL_BOOST_VERSION} REQUIRED)
endif()
I will make a PR for config based find_package(boost... ) asap then.
Another possibility would be to check if the POLICY CMP0167
is available
if (POLICY CMP0167)
set(QL_BOOST_VERSION 1.70.0)
# The FindBoost module is removed in cmake 3.30, finding the upstream BoostConfig.cmake
find_package(Boost ${QL_BOOST_VERSION} CONFIG REQUIRED)
else()
find_package(Boost ${QL_BOOST_VERSION} REQUIRED)
endif()
It gives a clearer picture why we distinguish between the two find_package(Boost ...)
methods and where to find information about it.
However, be aware that (almost?) all GitHub runners have updated to cmake v3.30
already.
For the macos
and ubuntu
runners it doesn't make a difference as the new CONFIG
file BoostConfig.cmake
is found automatically using the default methods (like apt
and brew
) to setup boost
.
For the windows
runners it is different when you download and extract the boost
binaries. You need to provide the environment variable Boost_DIR
with the path to the BoostConfig.cmake
file. Have a look here how this can be solved.
I will check it. Thank you.
Actually, it may not be a big deal.
I am currently using CMake >= 3.30 to build the project. It outputs a warning :
In CMake document, (cmake --help-policy CMP0167) it says
I think it is better to suppress such a warning until we require the minimum version of Boost >= 1.70.