Skip to content

cmake: install a snappy.pc pkg-config file - #265

Open
heitbaum wants to merge 1 commit into
google:mainfrom
heitbaum:add-pkg-config-file
Open

heitbaum wants to merge 1 commit into
google:mainfrom
heitbaum:add-pkg-config-file

Conversation

@heitbaum

Copy link
Copy Markdown

Motivation for re-raising this PR is the rework of the local patch we carry to add the .pc file given the recent activity here.

A refresh of #86 — happy for it to be closed again if the policy stands. It's worth refreshing either way: Version: now comes from @PROJECT_VERSION@ rather than a new SNAPPY_VER variable, so unlike #86 nothing here names a release and downstreams carrying it don't have to regenerate on every bump.

Uses GNUInstallDirs, handles a split prefix, sits inside the existing if(SNAPPY_INSTALL) guard. No new dependency.

#86 was declined in 2019 because the C++ ecosystem had no single packaging answer and any line drawn would be arbitrary. Since then:

The README says build-configuration contributions are unlikely to be accepted. That reads as out of date — #197, #200, #203, #213, #214, #258 and #260 are all CMakeLists.txt changes merged since. Happy to be told otherwise.

cc: @lavoiesl

Install a pkg-config file next to the CMake package config, so consumers
that discover dependencies through pkg-config can find an installed snappy.

The paths come from GNUInstallDirs and handle both a relative and an
absolute CMAKE_INSTALL_LIBDIR/INCLUDEDIR, so a split prefix resolves
correctly. The install sits inside the existing SNAPPY_INSTALL guard.

Version is read from PROJECT_VERSION, which project() already exports and
which this file already uses for VERSION/SOVERSION, so the .pc cannot drift
from the declared project version.

Reworked Sebastien Lavoie's patch to read PROJECT_VERSION rather than
introduce a separate SNAPPY_VER variable.

Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>

This branch has not been deployed

No deployments
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.

1 participant