# Can't include header files from other project

I want to create a package with just one header file and use this header file from other packages.

In the CMakeLists.txt "catkin_package(INCLUDE_DIRS include)" is defined and so is "install(DIRECTORY include/${PROJECT_NAME}/ ..." that was commented out in the default file. I added the HeaderProjectName as both run and build dependency in the client's package.xml. Still on compiling I get error that no such file as "HeaderProjectName/HeaderFile.h". What could be wrong or what am I missing? Using catkin on Groovy. edit retag close merge delete ## Comments 3 what your'e describing sounds correct. try this: instead of running catkin_make, go into the build folder and run make VERBOSE=1. you'll be able to see the include paths that way and get us more info. ( 2013-02-01 12:00:35 -0500 )edit 1 Try adding project dependency in manifest.xml ( 2013-02-01 17:52:42 -0500 )edit When the cpp file (that needs the header from other project) is compiled, then my header's directory is not used. ( 2013-02-01 22:01:45 -0500 )edit could you paste the output of the compile with verbose=1 out as well as your cmakelists.txt and package.xml for both projects? i don't have enough information right now ( 2013-02-05 07:56:20 -0500 )edit ## 1 Answer Sort by » oldest newest most voted In the client package you need to find_package your 'HeaderProjectName', something like this will add the includes path from HeaderProjectName: find_package(catkin REQUIRED COMPONENTS HeaderProjectName <other packages here>) include_directories(${catkin_INCLUDE_DIRS})


An alternative method is that you can find_package HeaderProjectName directly:

find_package(HeaderProjectName REQUIRED)

more