ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

As of Foxy Fitzroy ament_export_interfaces is deprecated, replaced with ament_export_targets. The documentation was outdated and has been updated in https://github.com/ros2/ros2_documentation/pull/804.

There's a recommendation in the tutorial to use a different EXPORT name than the library:

The EXPORT notation of the install call requires additional attention: It installs the CMake files for the my_library target. It is named exactly like the argument in ament_export_interfaces and could be named like the library. However, this will then prohibit using the ament_target_dependencies way of including your library. To allow for full flexibility, it is advised to prepend the export target with something like export_<target>.

I don't know if it solves your issue, but you could try making the following changes to your first CMakeLists.txt:

ament_export_targets(export_ftd2xx HAS_LIBRARY_TARGET)

ament_export_targets(export_EposCmd HAS_LIBRARY_TARGET)

install(
  DIRECTORY include/
  DESTINATION include
)

install(
  TARGETS ftd2xx
  EXPORT export_ftd2xx
  LIBRARY DESTINATION lib
  ARCHIVE DESTINATION lib
  RUNTIME DESTINATION bin
  INCLUDES DESTINATION include
)

install(
  TARGETS EposCmd
  EXPORT export_EposCmd
  LIBRARY DESTINATION lib
  ARCHIVE DESTINATION lib
  RUNTIME DESTINATION bin
  INCLUDES DESTINATION include
)