FindPkgConfig : Link failure when dependent module changes.
FindPkgConfig : Link failure when dependent module changes.
- cmake 3.16.4
- pkg-config 0.29.2
- GCC 7.4
- RHEL 6.8 x86_64
Summary:
Add external modules (.pc files) resolved by calls to pkg_check_module
as dependencies of the project or to configure-depends.
Description:
The pkg-config module files resolved during a call to pkg_check_module()
et al represent dependencies on a project in the same way as included header files do for compilation. Currently (cmake 3.16.4) this does not appear to be the case, as changes in a dependent module results in linkage failure as a target's link.txt
is not regenerated.
Workaround:
Perform a clean and rebuild. This is not always an option for CI builds where intervention is required.
Notes:
Difficult to do this ourselves as it would require "guessing" the search path used by pkg-config
as called from FindPkgConfig functions. Sure, we can make a good guess, but that would still be coupling internal behaviour of that cmake module with our projects.