-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add foundations for CMake support #254
Conversation
We start by creating the top-level `CMakeLists.txt` file, following the modern CMake guide (https://cliutils.gitlab.io/modern-cmake/). We already have a `build/` directory, so we'll use `cmake/build` for our build folder. We add this to `.gitignore` (using a `*` so as to support multiple build folders). We update the release instructions so as to keep the version number in sync, and the installation instructions so as to explain how to use CMake. Helps #215.
# The maximum version should be the latest version we've tested the project with. | ||
# | ||
# [1]: https://cliutils.gitlab.io/modern-cmake/chapters/intro/dodonot.html | ||
cmake_minimum_required(VERSION 3.23...3.29) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason that you chose cmake 3.23? Ubuntu 22.04.4 LTS packages cmake 3.22.1 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, the comment above explains the reasoning.
CMake is in some ways counter-intuitive, at least to me. There's a strong expectation that it will be very easy for users to get the latest version, and thus there are community norms around aggressively updating the minimum version. I will say, I was pleased to see how easy it was to grab 3.29 on Ubuntu, simply by adding the official PPA.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. I followed this SO post and the code below worked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Top-level code is documented and works with cmake 3.29.6.
We start by creating the top-level
CMakeLists.txt
file, following themodern CMake guide (https://cliutils.gitlab.io/modern-cmake/).
We already have a
build/
directory, so we'll usecmake/build
for ourbuild folder. We add this to
.gitignore
(using a*
so as to supportmultiple build folders).
We update the release instructions so as to keep the version number in
sync, and the installation instructions so as to explain how to use
CMake.
Helps #215.