You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
where ament_export_targets is called before ament_export_dependencies. There is also no mentioning if the order is relevant in any way in the docs.
In one of my projects I ran into some issues with this. Based on some experiments it seems ament_export_dependencies calls have to be placed before ament_export_targets.
The code will generate a <PackageName>Config.cmake file, which contains the following lines:
# include all config extra filesset(_extras "ament_cmake_export_dependencies-extras.cmake;ament_cmake_export_targets-extras.cmake")
foreach(_extra ${_extras})
include("${main_DIR}/${_extra}")
endforeach()
It is important that ament_cmake_export_dependencies-extras.cmake will be processed before ament_cmake_export_targets-extras.cmake, because the first one defined dependencies of the target.
If you switch the order of the commands as seen in the documentation, the order in this snipped is reversed as well and will lead to an error.
If necessary I might be able to post a reproducible example.
If I am correct with my assumption, I suggest that the documentation is updated for now to reflect the correct order and have some note about this behaviour. In the long run it would obviously better if the order would not matter and ament just always puts dependencies in the Config.cmake file first.
The text was updated successfully, but these errors were encountered:
I had troubles building from sources PicknikRobotics/RSL package from source with cmake 2.26 on ubuntu 20.04. Switching ament_export_dependencies and ament_export_targets solved the issue for me. May be related (but I don't have more time for digging here, not a cmake expert).
Hi,
the documentation suggests that you would do something like:
where
ament_export_targets
is called beforeament_export_dependencies
. There is also no mentioning if the order is relevant in any way in the docs.In one of my projects I ran into some issues with this. Based on some experiments it seems
ament_export_dependencies
calls have to be placed beforeament_export_targets
.The code will generate a
<PackageName>Config.cmake
file, which contains the following lines:It is important that
ament_cmake_export_dependencies-extras.cmake
will be processed beforeament_cmake_export_targets-extras.cmake
, because the first one defined dependencies of the target.If you switch the order of the commands as seen in the documentation, the order in this snipped is reversed as well and will lead to an error.
If necessary I might be able to post a reproducible example.
If I am correct with my assumption, I suggest that the documentation is updated for now to reflect the correct order and have some note about this behaviour. In the long run it would obviously better if the order would not matter and ament just always puts dependencies in the Config.cmake file first.
The text was updated successfully, but these errors were encountered: