FindPkgConfig docs: add more complete example for pkg_check_modules()
FindPkgConfig: add more complete example for pkg_check_modules()
.
More specifically, how to apply to a target the different variables that are output by a call to pkg_check_modules()
.
I currently use this utility function:
function (GswApplyPkgConfigDepsToTarget target_name pkg_dep)
target_include_directories ("${target_name}" PRIVATE ${${pkg_dep}_INCLUDE_DIRS})
target_compile_options ("${target_name}" PRIVATE ${${pkg_dep}_CFLAGS_OTHER})
target_link_libraries ("${target_name}" ${${pkg_dep}_LDFLAGS})
endfunction ()