gazebosim / gazebo-classic

Gazebo classic. For the latest version, see https://github.com/gazebosim/gz-sim
http://classic.gazebosim.org/
Other
1.17k stars 476 forks source link

export ignition math flags for pkgconfig #1641

Open osrf-migration opened 9 years ago

osrf-migration commented 9 years ago

Original report (archived issue) by John Hsu (Bitbucket: hsu, GitHub: hsu).


Since pull request #1534, gazebo depends on ign-math. If an external library depends on gazebo and includes gazebo/math/Vector3.hh, and it uses pkgconfig, it will fail to compile with following error:

In file included from /home/hsu/projects/gazebo_asme_2014/install_release/include/gazebo-6.0/gazebo/math/Pose.hh:27:0,
                 from /home/hsu/projects/gazebo_asme_2014/install_release/include/gazebo-6.0/gazebo/common/BVHLoader.hh:24,
                 from /home/hsu/projects/gazebo_asme_2014/install_release/include/gazebo-6.0/gazebo/common/common.hh:9,
                 from /home/hsu/projects/gazebo_asme_2014/install_release/include/gazebo-6.0/gazebo/gazebo_core.hh:19,
                 from /home/hsu/projects/gazebo_asme_2014/install_release/include/gazebo-6.0/gazebo/gazebo.hh:20,
                 from /home/hsu/projects/gwu_positronics/reveal/Reveal/../Reveal/sim/gazebo/helpers.h:10,
                 from /home/hsu/projects/gwu_positronics/reveal/Reveal/sim/gazebo/helpers.cpp:1:
/home/hsu/projects/gazebo_asme_2014/install_release/include/gazebo-6.0/gazebo/math/Vector3.hh:23:36: fatal error: ignition/math/Vector3.hh: No such file or directory
 #include <ignition/math/Vector3.hh>
                                    ^
compilation terminated.
make[2]: *** [Reveal/sim/gazebo/CMakeFiles/reveal_sim_gazebo.dir/helpers.cpp.o] Error 1
make[2]: Leaving directory `/home/hsu/projects/gwu_positronics/reveal/build'
make[1]: *** [Reveal/sim/gazebo/CMakeFiles/reveal_sim_gazebo.dir/all] Error 2
make[1]: Leaving directory `/home/hsu/projects/gwu_positronics/reveal/build'
make: *** [all] Error 2

unless we make downstream package depend on ignition-math2 as well.

On the contrary, the ignition-math2 flags are added directly to gazebo-config.cmake.

This seems a bit inconsistent on how pkgconfig and cmake config files are generated?

osrf-migration commented 9 years ago

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


I don't understand why this error occurs. As you mentioned in the link, the gazebo.pc file has a Requires entry for ignition-math2. Do you need to use the GAZEBO_CFLAGS variable?

osrf-migration commented 9 years ago

Original comment by John Hsu (Bitbucket: hsu, GitHub: hsu).


@scpeters

include_directories( ${GAZEBO_INCLUDE_DIRS} )

does not appear to contain paths to ignition-math2, maybe a bug in cmake module for pkg-config?

tagging @j-rivero

osrf-migration commented 7 years ago

Original comment by Nate Koenig (Bitbucket: Nathan Koenig).