gz-cmake
gz-cmake copied to clipboard
pkg-config does not include required components from dependencies
trafficstars
Environment
- OS Version: Ubuntu 24.04
- Source or binary build? gz-utils3
Description
- Expected behavior: The pkg-config file generated for a project to include required components from dependencies.
- Actual behavior: The generated file only includes the required core library of the dependency, but not any additional required components
Steps to reproduce
- Add the line
gz_find_package(gz-utils3 REQUIRED COMPONENTS log)
Right before gz_configure_build in https://github.com/gazebosim/gz-cmake/blob/3b33067c07460f95af3cbebfff76bdcff4e2d5fe/examples/core_nodep/CMakeLists.txt#L7
3. Assuming you have gz-utils3-log installed, build project and read the contents of cmake/pkgconfig/gz-core_no_deps.pc in the build directory. You should see
prefix=${pcfiledir}/../../
libdir=${prefix}/lib
includedir=${prefix}/include/gz/core_no_deps0
Name: Gazebo core_no_deps
Description: A set of core_no_deps classes for robot applications
Version: 0.1.0
Requires: gz-cmake4 >= 1.1 gz-utils3
Requires.private:
Libs: -L${libdir} -lgz-core_no_deps
Libs.private:
CFlags: -I${includedir} -std=c++11
In the Requires clause, there is gz-utils3, but not gz-utils3-log.