Yes, this will work. ament_export_libraries(...)
is basically the equivalent to catkin_package(LIBRARIES ...)
.
A “better” / more modern way would be to generate a CMake file containing code to import the actual targets in downstream packages. This needs to steps:
The usage downstream is than also different: see example.
We only do this in very few cases yet but the goal is to use this approach in all packages.