Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg-config does not include required components from dependencies #450

Open
azeey opened this issue Sep 3, 2024 · 2 comments · May be fixed by #451
Open

pkg-config does not include required components from dependencies #450

azeey opened this issue Sep 3, 2024 · 2 comments · May be fixed by #451
Labels
bug Something isn't working

Comments

@azeey
Copy link
Contributor

azeey commented Sep 3, 2024

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

  1. Add the line
gz_find_package(gz-utils3 REQUIRED COMPONENTS log)

Right before gz_configure_build in

gz_configure_build(QUIT_IF_BUILD_ERRORS)

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.

@azeey azeey added the bug Something isn't working label Sep 3, 2024
@scpeters
Copy link
Member

scpeters commented Sep 4, 2024

I noticed this too. I think the fix needs to be in the following lines of gz-config.cmake.in:

gz_pkg_config_entry is called once with the package name, but we should collect the names of required components and include those as well in a space-separated string (like gz-utils3 gz-utils3-log). This could be done by:

  • adding a gz_pkg_config_append_entry macro and calling that within the component for loop
  • or constructing the space-separated list of requirements in the for loop and moving the call to gz_pkg_config_entry after the for loop

@scpeters scpeters linked a pull request Sep 4, 2024 that will close this issue
8 tasks
@scpeters
Copy link
Member

scpeters commented Sep 4, 2024

potential fix in #451

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Inbox
Development

Successfully merging a pull request may close this issue.

2 participants