-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Boost cmake build requires CMake 3.14 or above #1081
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
base: develop
Are you sure you want to change the base?
Conversation
Actually CMake 3.8 (for support of the C++-standard feature) should work for most of Boost Cobalt requires 3.12, 2-3 libraries have bugs in their CMakeLists that get ignored in 3.19. So either the maintainer of Cobalt @klemens-morgenstern lowers that if possible or it might really be a good idea to have 3.12 as the minimum in the super-project. However that would exclude users from using an older version when not building Cobalt. |
The use case I have in mind is building (all of) boost. I think it's less of a priority to support very old versions of cmake, considering how easy it is to install a modern version of that. |
I think I now understand your reasoning that a lower version than 3.19 is possible. |
d69c749
to
79e98e4
Compare
Thanks to @Flamefire revised this to require cmake 3.15. It's Json that requires 3.15, as discussed at boostorg/json#1106 |
But this is not the only use case possible.
See the "most" here. Boost strives for high compatibility and some libraries do test with compilers as old as available on Ubuntu 16. So the minimum required version in the super project needs to be the minimum required version over all Boost libraries for the use case the user just cares about those. And when all libraries have "correct" CMakeLists the error
will appear even without a change to the super project so I don't see much gained by limiting this to 3.15 for users that don't need Boost.JSON. So I would suggest the above policy:
Hence I'd keep the current 3.5 minimum and just make sure that each project has a correct CML |
How many of those old installations even support C++20? Intuitively that seems unlikely, in which case cobalt doesn't build anything. So I could just do an early return. |
CMake supports In CMake you should not "do nothing". Just set the required standard to |
My view is that boost ought have a required cmake version. It's normal and expected that ancient cmake versions are not supported forever. cmake-3.15 is from 2019, six years is long enough. |
I'd put the CMake version on the same level as the C++ version: Every Boost library decides what it needs as long as it specifies this somewhere.
Agreed on that. We can be more lenient with the minimal CMake version than with e.g. the C++ standard.
Which library emits "log spam"? Can be easily fixed without raising the minimum CMake version. In any case it boils down to The only actionable item I see is ensuring the Super-Project CMake range is the union of all sub-projects (likely 3.8 to 3.23) and adding CI using both the minimum and maximum version to ensure it at least configures. I'll circulate this in the Slack channel to get the opinion of other authors. |
Given the concerns. |
What is the motivation of this? I.e. what is the added value of this? Currently when using less than 3.13 there is a warning that installation requires 3.13.
|
There will be an error, eventually. (Unless Boost.JSON was been specifically opted out of) As a bit of an aside I was googling around for cmake best practices as a sanity check.
Which broadly resonates with me that support cmake-3.5 (even partially) is at least a bit against the grain of cmake. |
@Flamefire As a bit of an aside, I had a sincere go at supporting old versions for a Boost.Sort stand-alone cmake builds. |
79e98e4
to
d1d10ef
Compare
Updated from cmake-3.15 to cmake-3.14 to account for boostorg/json#1106 currently in review. |
I don't agree with that. The error is really clear with a line referenced that clearly states the same what the error says: You require a newer CMake version than what you use. Having the very same error message in the Boost super project doesn't change anything but introduces a maintenance burden of having to keep track of changes to this in ALL individual Boost libraries. |
The broader problem is that boost seems to have little to say about what version of cmake is required, expected, supported or even recommended. That seems fine for each library to decide as stand-alone builds. But does seem problematic for the super-build that accepts (encourages? not clear) cmake version 3.5 but with the proviso that it all depends. If the first option is to require cmake-3.15, and second option is to warn about cmake-3.15 and before, perhaps a third option is to document what can can be expected with cmake-3.14 and earlier? I'm interested in establishing some cmake super-project build and test coverage for boost, but it does seem like CMake 3.15 is a workable baseline, without getting caught in these weeds. |
I've been poking around with the cmake build of boost.
See also boostorg/nowide#199 and boostorg/parser#277
What I'm finding on Ubuntu 24.04 is that boost requires cmake 3.19 or newer.
Various things break with cmake 3.18 in my experiments.
It seems possible that work could be done in various libraries to support older versions of cmake.
But it's not clear that work would be tidy, maintainable or valuable in a widespread sense.
So the proposal here is that boost simply requires cmake 3.19 and fails early and clearly otherwise.
I think this change would also be helpful in terms of library maintainers having some clarity about what version of cmake they can assume. Policy prior to cmake 3.10 was deprecated in cmake 3.31 and policy prior to cmake 3.5 was removed.
So it seems that cmake 3.10 is the most we could reasonably try to support for boost, but cmake 3.19 is where boost is at currently, in practice.