I'm trying to use target_find_dependencies
to add the dependencies for a STATIC
library that depends on some libraries that can be found via pkg-config
, I'm able to pass the PkgConfig
package to target_find_dependencies
but there doesn't seem to be an easy way to add the pkg_check_modules
calls to the CMake package config, is there any way I can solve this situation?
My old Config.cmake.in
file used to look like this:
@PACKAGE_INIT@
include(CMakeFindDependencyMacro)
find_dependency(Threads)
find_dependency(PkgConfig)
if(NOT TARGET PkgConfig::gio)
pkg_check_modules(gio REQUIRED IMPORTED_TARGET gio-2.0)
endif()
if(NOT TARGET PkgConfig::dbus)
pkg_check_modules(dbus REQUIRED IMPORTED_TARGET dbus-1)
endif()
include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]")
check_required_components(@TARGET_NAME@)
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too