Gazebo | Ignition | Community
Ask Your Question

CMake gazebo package not found when installing from source

asked 2014-06-01 13:18:23 -0500

AndreiHaidu gravatar image


After installing gazebo 3.0 from source (the installation path being my local home folder) the pkg_check_modules(GAZEBO gazebo) command from CMake does not find the gazebo package:

-- checking for module 'gazebo'
--   package 'gazebo' not found

As a workaround I added the absolute path for GAZEBO_INCLUDE_DIRS and GAZEBO_LIBRARY_DIRS in the CMakeLists.txt :

 set(GAZEBO_INCLUDE_DIRS /home/<path>/include/gazebo-3.0;/usr/include/sdformat-2.0)
 set(GAZEBO_LIBRARY_DIRS /home/<path>/lib/x86_64-linux-gnu)

Any way to fix this, or is it a bug?

Thanks, Andrei

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2014-06-01 14:41:09 -0500

silvio.traversaro gravatar image

If it is not strictly necessary to use pkg_check_modules, you can try with

find_package(gazebo REQUIRED)

That for me works perfectly with gazebo 3.0 installed from source.

edit flag offensive delete link more


thank you kind sir, it worked :)

AndreiHaidu gravatar imageAndreiHaidu ( 2014-06-02 02:07:19 -0500 )edit

answered 2015-02-04 18:24:23 -0500

scpeters gravatar image

Note that you should also make sure you have the appropriate -dev package installed (ie. libgazebo4-dev).

edit flag offensive delete link more

answered 2014-06-02 19:45:08 -0500

scpeters gravatar image

I upvoted the cmake find_package answer, since that is correct. For completeness, if you want to use pkg_check_modules, you should set the PKG_CONFIG_PATH environment variable to include the local pkgconfig folder:

export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:/home/<path>/lib/x86_64-linux-gnu/pkgconfig
edit flag offensive delete link more
Login/Signup to Answer

Question Tools


Asked: 2014-06-01 13:18:23 -0500

Seen: 3,497 times

Last updated: Feb 04 '15