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

Feature: add support for pkg-config for GEOS C API (only) #349

Merged
merged 1 commit into from Nov 27, 2020

Conversation

mwtoews
Copy link
Contributor

@mwtoews mwtoews commented Nov 24, 2020

This feature adds support for pkg-config, which is a helper tool used when compiling applications and libraries on *nix systems. It is similar to geos-config, but is more widespread and generic.

Take a look what you might already have, which should already include proj and gdal:

pkg-config --list-all

Here is how it works from the command line:

export PKG_CONFIG_PATH=/path/to/geos/prefix
pkg-config geos --modversion  # same as `geos-config --version`
pkg-config geos --cflags  # same as `geos-config --cflags`
pkg-config geos --libs  # same as `geos-config --clibs`

Or from autotools files for a custom project "myapp":

# configure.ac
PKG_CHECK_MODULES([GEOS], [geos])

# Makefile.am 
myapp_CFLAGS = $(GEOS_CFLAGS)
myapp_LDADD = $(GEOS_LIBS)

Some considerations:

  • It only links to the GEOS C API, by design
  • It can be installed from the autotools or cmake setups, as it's a simple configuration file
  • Static compilation has not been investigated yet, but could be. It's just a matter of adding .private sections to link in the configuration file to link any other libraries.
  • For a future release, consider deprecating geos-config, which is a custom tool with a similar purpose.

xref: https://trac.osgeo.org/geos/ticket/1073

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.

None yet

2 participants