Packages dependency and includes
Hi all,
I have a package1 which generates services via a Type1.srv file. These generated services are located in <catkin_ws>/devel/include/package1/Type1.h. This all works fine.
Now when I want a package2 to also use the services generated in package1 I follow the steps described in here.
Note that in my code I do not actually add package1 to find_package, because package1 is not compiled yet when find_package is called in package2.
Now when building I get the following error:
<catkin_ws>/src/package2/src/MyFile.cpp:2:32: fatal error: package1/Type1.h: No such file or directory
When I manually add include path <catkin_ws>/devel/include to include_directories, it compiles and links fine, but it is obviously very dirty...
Anyone knows what I am missing here? How can I let my system know about the include path to devel?
-------------------EDIT 1---------------
Note that when I add package1 to find_package(catkin REQUIRED COMPONENTS ... package1) I get the following error:
CMake Error at /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:83 (find_package): Could not find a package configuration file provided by "package1" with any of the following names:
package1Config.cmake
package1-config.cmake
Add the installation prefix of "package1" to CMAKE_PREFIX_PATH or set "package1_DIR" to a directory containing one of the above files. If "package1" provides a separate development package or SDK, be sure it has been installed.
-------------------EDIT 2---------------
File package1/package.xml does exist and has the following name
<package format="2">
<name>package1</name>
<version>0.1.0</version>
package1/CMakeLists.txt contains
project(package1)
...
catkin_package(
LIBRARIES ${PROJECT_NAME}
CATKIN_DEPENDS rtt_ros message_runtime std_msgs
)
and package2/CMakeLists.txt contains
find_package(catkin REQUIRED COMPONENTS roscpp std_msgs package1)
This causes the error described above.
-------------------EDIT 3---------------
I have created a MWE which can be found in this link. Both packages are in meta-package le_painters_companion, package1 corresponds to lc_control and package2 to lc_toolkitLink.
Does this MWE shed some more light on the problem?
Kind regards,
Antoine.