CMake Can't find Eigen3

后端 未结 1 1116
难免孤独
难免孤独 2020-12-31 01:09

I have copied FindEigen3.cmake into my source directory.

I then added:

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR})
相关标签:
1条回答
  • 2020-12-31 01:31

    It worked for me, when I installed the eigen3 package (e.g. using -DCMAKE_INSTALL_PREFIX=/home/doriad/install), and also set the CMAKE_INSTALL_PREFIX variable of the cmake package that is using eigen3 to the same directory.

    Because of the problems with findscripts, I've actually started using pkg-config instead. For that you need to enable pkg-config support in the eigen3 cmake, and use the pkg-config macro in your own cmake script. Advantage is that you don't need to set any environment variables anymore.

    find_package( PkgConfig )
    pkg_check_modules( EIGEN3 REQUIRED eigen3 )
    include_directories( ${EIGEN3_INCLUDE_DIRS} )
    
    0 讨论(0)
提交回复
热议问题