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
)
Read More:
- gazebo7 CMake Error:Could not find a package configuration file provided by “gazebo_plugins“
- but “catkin_make“ must be invoked in the root of workspace
- [How to Fix] NameError: name ‘requests‘ is not defined & NameError: name ‘request‘ is not defined
- Failed to dlsym make_device: undefined symbol: make_device
- An error is reported when passing data pages using Ajax: Vue is not defined
- When Linux installs redis, it executes make install and reports an error: Make: * * [server. O] error 1 (solved)
- **Gazebo error – [REST.cc:205] Error in REST request**
- Error: pngquant failed to build, make sure that libpng-dev is installed
- VBA “user defined type not defined” MSXML2.DOMDocument
- Error: [VueLoaderPlugin Error] No matching use for vue-loader is found. Make sure the rule matching
- [NLP] NameError in using nltk: name ‘freqdist’ is not defined
- Eslint error handling: ‘QQ’ is not defined
- Error reported using layui $is not defined
- Uncaught ReferenceError: FileAsyncWriter is not defined
- Reference error: ecarts is not defined
- pyspark : NameError: name ‘spark’ is not defined
- JS error: require is not defined
- How to make eclipse after the program is modified, click run to automatically save it.
- 23:4 error ‘xxx‘ is defined but never used no-unused-vars
- python multiprocessing.pool NameError: name is not defined