Tag Archives: catkin_package

catkin_make [Warning]:‘gazebo_LIBRARIES‘ is defined.

catkin_package() DEPENDS on ‘gazebo’ but neither ‘gazebo_INCLUDE_DIRS’ nor ‘gazebo_LIBRARIES’ is defined.
make use of DEPENDS in catkin_package(…)DEPENDS in catkin_package() not adding package INCLUDE_DIRS

Reason

This will not work in every listed case. In order to list something in DEPENDS, it needs to have matching case varaible names. For example, you put Ogre in the DEPENDS section, but Ogre produces these variables: OGRE_INCLUDE_DIRS and OGRE_LIBRARIES. Because the case is different, catkin has no way of mapping the name you give it to the variables which it produces. Others might work, like urdfdom, but Qt, Eigen, Ogre, and OpenGL will not work like this and you need to manually pass the correct variables along to INCLUDE_DIRS and LIBRARIES accordingly.

That is exactly correct, if the package does not follow the convention where <pkg_name> is used consistently in find_package(<pkg_name> …) and resulting variables like <pkg_name>_INCLUDE_DIRS, then catkin cannot determine it automatically.
In times like this you must manually pass include directories and libraries to the catkin_export call, and you cannot depend on the DEPENDS syntactic sugar.
For the documentation, I think it is already ticked here: #491

In brief, DEPENDS and the generated GAZEBO_INCLUDE_DIRS and GAZEBO_LIBRARIES do not correspond to the case in their names, and catkin cannot recognize the result.
Solution
Take gazebo as an example.
Modify the previous CMakeLists.txt:

catkin_package(
  INCLUDE_DIRS include
  CATKIN_DEPENDS roscpp std_msgs sensor_msgs geometry_msgs nav_msgs tf gazebo_ros
  DEPENDS gazebo
)

The revised CMakeLists.txt :

catkin_package(
  INCLUDE_DIRS include
  CATKIN_DEPENDS roscpp std_msgs sensor_msgs geometry_msgs nav_msgs tf gazebo_ros
  DEPENDS GAZEBO
)