How to add includes? [closed]
I want to add some classes to my node. The classes are stored in separate files. So now I add header includes, for example
#include "HardwareSerial.h"
But the appropriate .cpp file cannot be viewed by compiler automatically. So I write the following in my CMakeLists.txt
add_library(hardwareserial src/HardwareSerial.cpp)
target_link_libraries(talker ${catkin_LIBRARIES} hardwareserial)
And it works.
But how can I add a whole directory to scan for .cpp files so that I could only include headers and appropriate .cpp files would be attached automatically without add_library instruction for each file?
This is a pure CMake question not a ROS question. Please reask on a more specifically scoped forum. I'd suggest considering: https://stackoverflow.com/questions/t...