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

CMake script improvements (compat with s2 v0.11) #19

Merged
merged 9 commits into from
Aug 15, 2024

Conversation

benbovy
Copy link
Collaborator

@benbovy benbovy commented Aug 14, 2024

Some updates to the cmake script(s):

  • support both s2geometry versions <0.11 (still using the Finds2.cmake module) and >=0.11 (using the config file installed with s2)
  • bump the s2geometry version to 0.11.1 with the S2_SOURCE=BUNDLE option.
  • silent warnings from s2 headers with the S2_SOURCE=BUNDLE option (closes Noisy Tests Build #14)
  • add cmake configuration files for reusing s2geography as dependency in downstream cmake projects

@paleolimbot @pramsey I had to add some (quite ugly) workarounds to make #13 work (S2_VERSION_** were undefined so the old definition of S2CellRelation was still selected even with s2 v0.11). As you mentioned there is still no easy way to get the version of s2 when it is found via find_package(). I'm not sure that requiring the user to manually specify the version (e.g., as a cmake option) would be better.

To make things easier to maintain, I'm wondering if we couldn't just drop supporting versions of s2 < 0.11? For my usage (Python / spherely) that would be fine. What about your usage? Any thoughts?

Not really useful (not sure anyone wants to build tests with
coverage *and* install the library at the same time) but should probably
fix CI.
@paleolimbot
Copy link
Owner

What about your usage?

This is fine with my usage (we're about to finally update the s2 version in the R package), but it might be worth keeping the defines (or a comment explaining that this bit of code would need to change if using an older version).

Copy link
Owner

@paleolimbot paleolimbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also...thanks!

@benbovy
Copy link
Collaborator Author

benbovy commented Aug 15, 2024

Cool thanks!

Any objections if I cut a 0.1.1 release after merging this PR? It will help me moving forward with packaging in Spherely.

@benbovy benbovy merged commit 277e4b9 into paleolimbot:master Aug 15, 2024
4 checks passed
@benbovy benbovy deleted the s2-0.11-compat branch August 15, 2024 07:09
@benbovy
Copy link
Collaborator Author

benbovy commented Aug 19, 2024

Any objections if I cut a 0.1.1 release after merging this PR? It will help me moving forward with packaging in Spherely.

I went ahead and published https://github.com/paleolimbot/s2geography/releases/tag/0.1.1 (hope you don't mind!)

@benbovy
Copy link
Collaborator Author

benbovy commented Aug 19, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Noisy Tests Build
3 participants