iirob / ros_opcua_communication

GNU Lesser General Public License v3.0
37 stars 35 forks source link

Export FreeOpcUa Libraries #24

Closed DavidMerzJr closed 4 years ago

DavidMerzJr commented 4 years ago

Currently, the header files for FreeOpcUa are being exported as part of the ros_opcua_impl_freeopcua catkin package, but the library binaries are not also being exported. If a downstream user attempts to include those header files, they will experience linking errors. To address this, they have to dig the library target names out of the FreeOpcUa CMakeLists file and directly add them to target_link_libraries in the user's CMakeLists.txt.

This commit addresses the issue by adding the four non-testing FreeOpCua libraries to the catkin_package() macro in the ros_opcua_impl_freeopcua CMakeLists.txt file. This should allow users to freely include the already-exported headers without linking errors.

This pull request is predicated on the assumption that the ros_opcua_impl_freeopcua package was meant to expose FreeOpcUa to any downstream ROS packages.

destogl commented 4 years ago

Thanks for your PR! Should we also install those libraries?

If so could you add this into PR?

DavidMerzJr commented 4 years ago

FreeOpcUa is already installing them. I tested in my current workspace (with --install set). It was not necessary to add the FreeOpcUa libraries to the install rules for ros_opcua_impl_freeopcua. The installations inside FreeOpcUa, while slightly different from the normal ROS installation rules, were sufficient to find them once the libraries were being exported in the catkin_package() macro.