How can I make pkg-config find both dependencies installed via Conan AND dependencies that are not in Conan?
My target package is built using CMake and finds its dependencies using pkg-config with pkg_check_modules()
. One of the dependencies (glib-2.0
) is installed via Conan, another (libsecret-1
) isn't, as there's no package.
In my conanfile I'm configuring the pkg-config_installer as a build requirement (self.build_requires("pkg-config_installer/0.29.2@bincrafters/stable")
. When building the package, CMake correctly invokes this pkg-config.
As a result, pkg-config finds glib just fine, but it cannot find libsecret. I assume it finds .pc
files for dependencies installed via Conan, but doesn't find libsecret-1.pc
, which is located in /usr/lib/pkgconfig/
on my system.
I tried telling Conan's CMake tool to use this path: tools.PkgConfig("libsecret-1").variables["pcfiledir"]
tells me where it is and the CMake tool's configure method has a pkg_config_paths
parameter. Unfortunately, this changes nothing.