Skip to content

Commit

Permalink
Specify required components in pkg-config
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Peters <[email protected]>
  • Loading branch information
scpeters committed Sep 4, 2024
1 parent 2425121 commit df30051
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions cmake/gz-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,8 @@ endif()
set(@LEGACY_PROJECT_PREFIX@_LIBRARIES ${@PKG_NAME@_LIBRARIES})
set(@LEGACY_PROJECT_PREFIX@_INCLUDE_DIRS ${@PKG_NAME@_INCLUDE_DIRS})

# This macro is used by gz-cmake to automatically configure the pkgconfig
# files for Gazebo projects.
gz_pkg_config_entry(@PKG_NAME@ "@PKG_NAME@")
# required pkg-config components
set(@PKG_NAME@_required_components)

# Find each of the components requested by find_package(~)
foreach(component ${@PKG_NAME@_FIND_COMPONENTS})
Expand All @@ -166,6 +165,8 @@ foreach(component ${@PKG_NAME@_FIND_COMPONENTS})
# find_dependency(~)
find_dependency(@PKG_NAME@-${component} @PROJECT_VERSION_FULL_NO_SUFFIX@ EXACT)

set(@PKG_NAME@_required_components "${@PKG_NAME@_required_components} @PKG_NAME@-${component}")

else()

# If this is an optional component, use find_package(~) instead of
Expand All @@ -177,6 +178,11 @@ foreach(component ${@PKG_NAME@_FIND_COMPONENTS})

endforeach()

# This macro is used by gz-cmake to automatically configure the pkgconfig
# files for Gazebo projects.
gz_pkg_config_entry(@PKG_NAME@ "@PKG_NAME@ ${@PKG_NAME@_required_components}")
unset(@PKG_NAME@_required_components)

# Specify the doxygen tag file
set(@PROJECT_NAME_NO_VERSION_UPPER@_DOXYGEN_TAGFILE "${PACKAGE_PREFIX_DIR}/@GZ_DATA_INSTALL_DIR@/@[email protected]")

Expand Down

0 comments on commit df30051

Please sign in to comment.