ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

Hi,

One simple technique would be to copy all the source files and header files in the "src" directory.

In CMakelists You'll have to add the following lines:

rosbuild_add_library(binary_name src/file_name_1)

rosbuild_add_executable(binary_name src/file_name_2)

file_name_1 is the cpp file that contains the class definition. file_name_2 is the cpp file containing the main() function. The header file, I believe would already be included in the cpp file containing class definition and hence is not required to be added in the Cmakelists.

This technique should most probably work with your scenario if I understood it right.

Good luck.

Hi,

One simple technique would be to copy all the source files and header files in the "src" directory.

In CMakelists You'll have to add the following lines:

rosbuild_add_library(binary_name src/file_name_1)

rosbuild_add_executable(binary_name src/file_name_2)

rosbuild_add_library(binary_name src/file_name_1)
rosbuild_add_executable(binary_name src/file_name_2)

file_name_1 is the cpp file that contains the class definition. file_name_2 is the cpp file containing the main() function. The header file, I believe would already be included in the cpp file containing class definition and hence is not required to be added in the Cmakelists.

This technique should most probably work with your scenario if I understood it right.

Good luck.