paleolimbot / s2geography

Simple features (ish) for s2geometry
Apache License 2.0
33 stars 4 forks source link

CMake: export s2 version numbers as public target compile defs #20

Closed benbovy closed 2 months ago

benbovy commented 2 months ago

This adds the s2geometry version numbers as public compilation definitions to the s2geography target, so we don't need to figure out and add those definitions again in every downstream cmake project where s2geography is included as an external dependency via find_package.

As a consequence it somehow enforces a project using the same s2geometry version that was used to build s2geography. Is there any reason not doing that?

paleolimbot commented 2 months ago

Is there any reason not doing that?

I don't think so! We expose the S2 headers as part of our implementation with the expectation that the user is going to want to use them to do something beyond what we can do here. Eventually we could test/support what happens if somebody has already imported the s2::s2 target and runs add_subdirectory() on s2geography, but no need to do that unless somebody asks!