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: use imported GDAL target and clean up dependencies #5263

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nilason
Copy link
Contributor

@nilason nilason commented Mar 2, 2025

  • Use CMake's FindGDAL.cmake and use imported GDAL::GDAL target.
  • Include GDAL include dir with public scope to grass_vector, grass_interpfl and grass_gproj targets enabling the use of those libraries as dependencies without adding GDAL::GDAL as dependency.
  • Remove dependency of GDAL::GDAL from targets which do not need it.

- Use CMake's FindGDAL.cmake and use imported GDAL::GDAL target.
- Include GDAL include dir with public scope to grass_vector,
  grass_interpfl and grass_gproj targets enabling the use of those
  libraries as dependencies without adding GDAL::GDAL as dependency.
- Remove dependency of GDAL::GDAL from targets which do not need it.
@nilason nilason added this to the 8.5.0 milestone Mar 2, 2025
@echoix
Copy link
Member

echoix commented Mar 2, 2025

I like this! It goes in the same thoughts as what I described here to be able to configure on windows last week. #5192 (comment)

The (draft) changes I made are here: echoix#379

I don't feel qualified to judge for the other changes, appart from the part of removing the custom FindGDAL and using the imported targets GDAL::GDAL; that looks fine to me.

@echoix
Copy link
Member

echoix commented Mar 2, 2025

One difference I see from their docs and here, is the find_package call that doesn't specify to use "CONFIG" mode. Does that mean it will use cmake's old FindGDAL instead of using config mode?

@nilason
Copy link
Contributor Author

nilason commented Mar 2, 2025

One difference I see from their docs and here, is the find_package call that doesn't specify to use "CONFIG" mode. Does that mean it will use cmake's old FindGDAL instead of using config mode?

It will use CMake's (currently 3.16+) FindGDAL. Bear in mind we still support pre-cmake builds of GDAL (<3.5) too.

@github-actions github-actions bot added CI Continuous integration vector Related to vector data processing raster Related to raster data processing database Related to database management libraries module general display raster3d CMake labels Mar 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous integration CMake database Related to database management display general libraries module raster Related to raster data processing raster3d vector Related to vector data processing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants