Skip to content
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

Merged
merged 1 commit into from
Jul 2, 2024
Merged

Conversation

chiphogg
Copy link
Contributor

@chiphogg chiphogg commented Jul 2, 2024

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.

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.
@chiphogg chiphogg added the release notes: ⚙️ repo PR affecting the way the repository works label Jul 2, 2024
@chiphogg
Copy link
Contributor Author

chiphogg commented Jul 2, 2024

# 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)
Copy link
Contributor

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 😄

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor

@geoffviola geoffviola left a 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.

@chiphogg chiphogg merged commit ebf44c5 into main Jul 2, 2024
10 checks passed
@chiphogg chiphogg deleted the chiphogg/cmakelists-base#215 branch July 2, 2024 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release notes: ⚙️ repo PR affecting the way the repository works
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants