ECMGeneratePkgConfigFile: add variables used by pkg_check_modules
ClosedPublic

Authored by dfaure on Mar 4 2019, 10:26 AM.

Details

Summary

If we ever end up in a situation where the generated .pc file is
actually used by cmake's pkg_check_modules, then we need the
includedir and libdir variables; pkg_check_modules ignores the
Makefile-like Libs and Cflags lines of the .pc file.

Context: craft adds a cmake buildsystem for sqlite3, which is then
found using pkgconfig in akonadi.

Test Plan

Filipe Azevedo is doing all the testing, I'm just providing patches :)

Diff Detail

Repository
R240 Extra CMake Modules
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 9152
Build 9170: arc lint + arc unit
dfaure created this revision.Mar 4 2019, 10:26 AM
Restricted Application added projects: Frameworks, Build System. · View Herald TranscriptMar 4 2019, 10:26 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
dfaure requested review of this revision.Mar 4 2019, 10:26 AM
fazevedo accepted this revision.Mar 4 2019, 11:20 AM
fazevedo added a subscriber: fazevedo.

Works for me !

This revision is now accepted and ready to land.Mar 4 2019, 11:20 AM
cgiboudeaux added a subscriber: cgiboudeaux.EditedMar 4 2019, 11:27 AM

The autotest has to be fixed as well

cgiboudeaux requested changes to this revision.Mar 4 2019, 11:27 AM
This revision now requires changes to proceed.Mar 4 2019, 11:27 AM

The autotest has to be fixed as well

Comment edited, the includedir value is correct for this test.

dfaure updated this revision to Diff 53114.Mar 4 2019, 11:52 AM

Update unittests, passes now

cgiboudeaux accepted this revision.Mar 4 2019, 12:23 PM

Thanks.

This revision is now accepted and ready to land.Mar 4 2019, 12:23 PM
dfaure closed this revision.Mar 4 2019, 12:35 PM

FWIW, this still results in inproper pc files, from what I heard recently. The prefix variable can be overriden from outside when calling pkg-config (cmp. pkg-config --help) to allow for relocatable installations. Same like CMake Config files also allow relocation by having the install prefix not hardcoded into directory var values.

So ideally any other paths expressions in the pc file use at least the prefix variable.

No more info here myself.