Is this the external project you’re mentioning?
If so, it looks like there’s already a package for SOEM in Noetic: ROS Package: soem . Remove the ExternalProject
and depend on the soem
package instead.
Generally vendoring dependencies in your package through ExternalProject or FetchContent is strongly discouraged. If two packages vendor different versions of the same dependency, and another package depends on both then undefined behavior can happen. For example, with C++ the one-definition rule can be violated.
Use system packages when possible. In order, the things to try are:
- Find an existing rosdep key on https://index.ros.org/ for the dependency you want to use, and use that
- If there’s no rosdep key, find an exisiting Ubuntu or Debian package for the dependnecy you want to use, and create a rosdep key for that
- If there’s no system package, for ROS 1 follow the REP 136 process to release the third-party package into ROS (In this case it looks like someone has already done this for soem)