ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

CMake: Eigen include dirs from an external library [closed]

asked 2014-05-06 23:29:38 -0500

jotaraul gravatar image

updated 2014-05-06 23:32:37 -0500

Hi all,

I've implemented a library which uses Eigen3. The following lines are part of the CMake of this library:

# EIGEN
find_package(Eigen3 REQUIRED)
include_directories(${EIGEN3_INCLUDE_DIR})

And Eigen3 is found and my library compiles without any problem.

The complication appears when I use my library into a ROS node. This node has nothing to be with Eigen, it is not used there. However, if I don't include the Eigen include dirs in this project as well, its compilation fails.

My library is compiled as a dynamic one, and I guess some Eigen stuff is missing from it, and that's why the node needs Eigen include directories as well. Any idea about how to fix this?

Thank you.

PS: I'm in Ubuntu 13.04 and using QtCreator as IDE.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by jotaraul
close date 2014-05-06 23:43:53

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-05-06 23:43:21 -0500

jotaraul gravatar image

I got this nice answer from other source:

Eigen is a header only library (save for some blas bindings). The only way to make sure Eigen isn't required as a build time dependency when your library is used is to only include Eigen headers in your library's source files, and none in your headers. This may require some wrapping of Eigen types and functions with PIMPL or some such.

If this is the case already, your question is missing information.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-05-06 23:29:38 -0500

Seen: 670 times

Last updated: May 06 '14