mapbox / spatial-algorithms

Spatial algorithms library for geometry.hpp
35 stars 10 forks source link

Cmake with out connectivity #7

Closed flippmoke closed 6 years ago

flippmoke commented 7 years ago

@artemp wanted to see if it was possible to add flags to the way that mason_use in cmake operated such that it could point to an external library by default. This is not critical but could be very nice at times.

daniel-j-h commented 7 years ago

In OSRM we use a ENABLE_MASON option. What you could also do is find_package(X) and if the package could not be found on the user's system fall back to mason.

https://cmake.org/cmake/help/v3.0/command/find_package.html

springmeyer commented 7 years ago

Let's keep the default be to use mason packages.

Let's also ensure that once the mason_packages folder is downloaded, any subsequent builds re-use it without needing connectivity. I presume @artemp would be happy to depend on network once as long as he could then be offline and develop/rebuild. This should be feasible, and should be the way things work currently. @flippmoke can you confirm?

springmeyer commented 6 years ago

I'm working on a slightly revised way to declare mason deps that will reduce the coupling of mason logic and cmake syntax. Stay tuned, will post a PR in the next few weeks when I have something to show.

springmeyer commented 6 years ago

WIP: https://github.com/mapbox/spatial-algorithms/pull/15

flippmoke commented 6 years ago

I think it might be productive to make this library use a layout similar to https://github.com/mapbox/hpp-skel. This would enable us to develop quickly between our different libraries. I feel that if we want to make this sort of interoperability possible we should frame it out in hpp-skel and then migrate it to all our libraries.

springmeyer commented 6 years ago

closing per https://github.com/mapbox/spatial-algorithms/pull/15#issuecomment-378996945: in short, this issue is now to be raised at hpp-skel (where we discuss best practices for repos based on hpp-skel).