Using a_pkg cmake extras in b_pkg cmake extras
I have a situation where I want to use CMake macros defined in a_pkg
cmake extras (defined via CFG_EXTRAS
) in b_pkg
's cmake extras.
For this, in b_pkg
I define a buildtool_export_depend
on a_pkg
. If I then try to build c_pkg
with an buildtool_depend
on b_pkg
, it fails, since while trying to load the cmake extras from b_pkg
the macro from a_pkg
's extras is not found.
It makes sense why this would happen, since nowhere does anyone call find_package
on a_pkg
. But what is the correct way to deal with this?
Does it make sense to manually call find_package(a_pkg REQUIRED)
in b_pkg
's cmake extras file, or should there be another mechanism? Note that I do not buildtool_depend
or build_depend
on a_pkg
in b_pkg
, and therefore also don't call find_package(catkin ...)
with a_pkg
in the component list.
Here are the example packages: https://github.com/NikolausDemmel/tes...
Note: Try the example package with catkin_make
, since catkin build
seems to have an issue with buildtool_export_depend
, see https://github.com/catkin/catkin_tool...