-
-
Notifications
You must be signed in to change notification settings - Fork 393
cmake: add export target config files #6877
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
base: main
Are you sure you want to change the base?
Conversation
|
@m-kuhn Is there any possibility that you can test this PR soon, or will it be good for you to test later on from main when you find the time? |
|
It builds well here, thanks There is one problem remaining, that (absolute) include paths of dependencies are propagated as include paths for grass and end up in the exported config. As far as I can see, this line can just be removed. vcpkg build output (with the line removed): Is it correct, that we need all targets exported (I just did |
Thanks for testing, really appreciate it!
The problem is, unfortunately, that the GRASS lib's API exposes API from a couple of third party libraries. See #5263 for the rationale behind that line. So a third party software linking to the GRASS vector library also need, for example, GDAL include path, but not necessarily need to link to GDAL. I'm not sure how to solve that differently.
How about |
I am do not completely understand the problem yet. These types are accessed through e.g.
That's what I expect to use. Is there also a need for |
The GDAL (and PostgreSQL) types are part of grass/include/grass/vect/dig_structs.h Line 1388 in bc06217
I'll see if I can find out a workaround to target_include_directories. I'm curious, is the absolute path in the target a problem/blocker from your point of view?
The Addons typically use bitmap btree2 dbmibase gis gmath gproj imagery linkm raster segment vector. The rest of the libraries are not very likely to be used, but as the targets are generated automatically, why not keep them. |
Alternative to #6869.
This is the first part of an update to add CMake support for
g.extension, extracted here the CMake export target configuration files part, to simplify review .In addition to the "pure" export, the following updates are added:
The targets exported are in the pattern
GRASS::<grass-lib-name-in-lowercase>, e.g.GRASS::gis,GRASS::raster.cc @m-kuhn