ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Anyone able to help me solve this in an elegant way?
Do you have a reason for wanting to directly include src files from package2
into programA
? We normally (not just in ROS / with catkin) solve these kind of things by creating a library in package2
, making sure package2/include
is on the include path of whatever pkg programA
is in, and then linking libpkg2
to programA
.
2 | No.2 Revision |
Anyone able to help me solve this in an elegant way?
Do you have a reason for wanting to directly include src files from package2
into programA
? ?
We normally (not just in ROS / with catkin) solve these kind of things by creating a library in package2
, making sure package2/include
is on the include path of whatever pkg programA
is in, and then linking libpkg2
to programA
.
I would consider using libraries like this an elegant way.
3 | No.3 Revision |
Anyone able to help me solve this in an elegant way?
Do you have a reason for wanting to directly include src files from package2
into programA
?
We normally (not just in ROS / with catkin) solve these kind of things by creating a library in package2
, making sure package2/include
is on the include path of whatever pkg programA
is in, and then linking libpkg2
to programA
.
I would consider using libraries like this an elegant way.
Edit:
Whilst your suggestion is fine, it's not the way we handle this kind of situation in our Lab, when using our own build system. Catkin/CMake is not our preferred tool chain. With that in mind, I prefer to reference it in the other package than create a duplicate.
Well, I must say that I wouldn't put recompiling source files for every target under elegant, but just to answer your question:
it would appear the variable <pkg_name>_SOURCE_PREFIX
contains the path your are looking for. I haven't used this myself, and afaict it is undocumented (which means it may stop working / be removed at any time), but it should get you what you are after.
4 | No.4 Revision |
Anyone able to help me solve this in an elegant way?
Do you have a reason for wanting to directly include src files from package2
into programA
?
We normally (not just in ROS / with catkin) solve these kind of things by creating a library in package2
, making sure package2/include
is on the include path of whatever pkg programA
is in, and then linking libpkg2
to programA
.
I would consider using libraries like this an elegant way.
Edit:
Whilst your suggestion is fine, it's not the way we handle this kind of situation in our Lab, when using our own build system. Catkin/CMake is not our preferred tool chain. With that in mind, I prefer to reference it in the other package than create a duplicate.
Well, I must say that I wouldn't put recompiling source files for every target under elegant, but just to answer your question:
it would appear the variable <pkg_name>_SOURCE_PREFIX
contains the path your are looking for. I haven't used this myself, and afaict it is undocumented (which means it may stop working / be removed at any time), but it should get you what you are after.
find_package(..)
the pkg first, or have included it in a find_package(catkin .. COMPONENTS ..)
call.