Including generated headers from devel/include space
Hello,
I have a package, let's call it gen. It is built under catkin kinetic and I can see the gen.h in workspace/devel/include.
In another package, let's call it toCompile. The code is unable to find gen.h
workspace/src/toCompile/include/toCompile/source_toCompile.h:23:27: fatal error: "gen/gen.h": No such file or directory
I have tried to apply a previous question A but I don't understand what should be inside foo.h.in. It still can't find the header.
Also tried to add (include ${CATKIN_DEVEL_PREFIX}/include)
but it makes no difference.
cmake_minimum_required(VERSION 2.8.3)
project(mav_planning_utils)
find_package(catkin REQUIRED COMPONENTS roscpp gen)
include_directories(include ${Eigen_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS})
include_directories(include ${CATKIN_DEVEL_PREFIX}/include)
catkin_package(
CATKIN_DEPENDS roscpp gen
INCLUDE_DIRS include ${Eigen_INCLUDE_DIRS}
LIBRARIES yaml-cpp ${PROJECT_NAME} ${PROJECT_NAME}_timing ${PROJECT_NAME}_rpoly
CFG_EXTRAS export_flags.cmake
)
add_subdirectory(src/library)
add_subdirectory(src/test)
add_subdirectory(src/nodes)
The exportflags just has `SET(CMAKECXXFLAGS "${CMAKECXX_FLAGS} -std=c++11")`
I assuming the headers are already in the correct place (devel/include) it's just a question of pointing catkin in the right direction. Also, this worked fine in indigo and broke in kinetic.
Thank you for any help!
Asked by kotoko on 2017-11-08 04:37:43 UTC
Answers
Your question is similar to this one (with answer): https://answers.ros.org/question/201977/include-header-file-from-another-package-indigo/
Asked by Wilco Bonestroo on 2019-11-14 16:33:34 UTC
Comments
How did you get your gen.h installed to workspace/devel/include? All of the examples I could find don't actually copy the headers there -- I can still compile fine, but I'd like to have all the headers in a central place for ease of use in my IDE
Asked by davrsky on 2018-01-03 14:16:29 UTC
I ended up not using the code I was trouble with so no idea, sorry.
Asked by kotoko on 2018-01-05 11:08:48 UTC