Underlying DDS library being exported when it shouldn't be

I could use some help fixing this warning:

CMake Warning at /home/brannon/ros2b3/share/rmw_coredx_cpp/cmake/ament_cmake_export_libraries-extras.cmake:62 (message):
  Package 'rmw_coredx_cpp' exports the library
  'BuildAgents/BuildAgent2-Work/1e20a6e96c2be131/install/coredx-4.0.20/target/Linux_2.6_x86_64_gcc43/lib/libdds_rpc_cpp.so'
  which doesn't exist

libdds* are the compiled CoreDX libraries. I believe that I don’t need them cmake-exported. (I need them present on the machine, but they don’t need to be in the same path that the build server used for things to work correctly.) It appears that somebody tried to fix this in rmw_opensplice recently. Please see the cmake files in this repository: https://github.com/asirobots/rmw_coredx

The file ament_cmake_export_libraries-extras.cmake gets its information from this call in the rmw_coredx package: https://github.com/asirobots/rmw_coredx/blob/fffe64adc36a8016459c95e9c54a5feec50b1b0c/rmw_coredx_cpp/CMakeLists.txt#L82

I assume the second part (${CoreDX_LIBRARIES}) is the library libdds_rpc_cpp.so you are seeing here? I am not sure if you can just remove it from being exported - you can give it a try.

If that doesn’t work you probably want to export the library names instead of their absolute paths.

If you end up needing to export the libraries, here’s a PR from rmw_fastrtps_cpp showing how we avoided full paths: https://github.com/ros2/rmw_fastrtps/pull/128/files

Thanks for the quick suggestions and good support on this. I have it fixed. Following your suggestions, I modified the problematic line to look like this:
ament_export_libraries(rmw_coredx_cpp)
list(APPEND rmw_coredx_cpp_LIBRARIES ${CoreDX_LIBRARIES})