Eigen3 include problem with KDL

Hi!

I went through the KDL installation http://www.orocos.org/kdl/installation-manual .

So I installed Eigen3 then KDL.

When I include the following hpp files

#include <kdl/chain.hpp>
#include <kdl/chainfksolver.hpp>
#include <kdl/chainfksolverpos_recursive.hpp>
#include <kdl/frames_io.hpp>

I get the following compiling error:

/usr/local/include/kdl/jacobian.hpp:26:22: fatal error: Eigen/Core: No such file or directory

but Eigen/Core is indeed installed in my

/usr/local/include/eigen3/Eigen/Core

I solved the issue by including the reference to the installation directory in the CMakelists of my component, but I reckon there must be a cleaner solution.

include_directories (/usr/local/include/eigen3)

During KDL installation, doing ccmake I can see the following:

 BUILD_MODELS                     OFF                                    
 CMAKE_BUILD_TYPE                 Release                                
 CMAKE_INSTALL_PREFIX             /usr/local                             
 CPACK_PACKAGES                   OFF                                    
 CPPUNIT                          CPPUNIT-NOTFOUND                       
 CPPUNIT_HEADERS                  CPPUNIT_HEADERS-NOTFOUND               
 EIGEN3_INCLUDE_DIR               /usr/local/include/eigen3              
 ENABLE_EXAMPLES                  OFF                                    
 ENABLE_TESTS                     OFF                                    
 Eigen_DIR                        Eigen_DIR-NOTFOUND                     
 KDL_VERSION                      1.1.99                   
The EIGEN3_INCLUDE_DIR path is correct, but Eigen_DIR is set to Eigen_DIR-NOTFOUND.

Any clue? Perhaps something got broken with the latest update of Eigen3?

Cheers

Niccolo'

Eigen3 include problem with KDL

I can correctly use Eigen3.

Put the FindEigen3.cmake into "(yourComponentPath)/modules/"

add to your CMakeLists.txt:

  set ( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/modules/  )
  find_package( Eigen3 REQUIRED)
  ...
  include_directories(${EIGEN3_INCLUDE_DIR})
It should be enough... Fabrizio

---FindEigen3.cmake---

 FIND_PATH(EIGEN3_INCLUDE_DIR Eigen/Core /usr/include /usr/include/eigen3 /usr/local/include /usr/local/include/eigen3)
  IF ( EIGEN3_INCLUDE_DIR )
      MESSAGE(STATUS "-- Looking for Eigen3 - found")
      SET(KDL_CFLAGS "${KDL_CFLAGS} -I${EIGEN3_INCLUDE_DIR}" CACHE INTERNAL "")
  ELSE ( EIGEN3_INCLUDE_DIR )
      MESSAGE(FATAL_ERROR "-- Looking for Eigen3 - not found")
  ENDIF ( EIGEN3_INCLUDE_DIR )