Ubuntu18.04编译PL-VIO时遇到:By not providing "FindEigen3.cmake" in CMAKE_MODULE_PATH,原因是找不到FindEigen3.cmake,错误如下:
CMake Warning at src/PL-VIO/benchmark_publisher/CMakeLists.txt:26 (find_package):
By not providing "FindEigen3.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Eigen3", but
CMake did not find one.
Could not find a package configuration file provided by "Eigen3" with any
of the following names:
Eigen3Config.cmake
eigen3-config.cmake
Add the installation prefix of "Eigen3" to CMAKE_PREFIX_PATH or set
"Eigen3_DIR" to a directory containing one of the above files. If "Eigen3"
provides a separate development package or SDK, be sure it has been
installed.
然后我们看出错提示中的路径中的CmakeLists.txt:
cmake_minimum_required(VERSION 2.8.3)
project(benchmark_publisher)
set(CMAKE_BUILD_TYPE "Release")
set(CMAKE_CXX_FLAGS "-std=c++11 -DEIGEN_DONT_PARALLELIZE")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall -g -rdynamic")
find_package(catkin REQUIRED COMPONENTS
roscpp
tf
)
catkin_package()
include_directories(${catkin_INCLUDE_DIRS})
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
find_package(Eigen3 REQUIRED)
set(EIGEN3_INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS})
include_directories(
${catkin_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIR}}
)
add_executable(benchmark_publisher
src/benchmark_publisher_node.cpp
)
target_link_libraries(benchmark_publisher ${catkin_LIBRARIES})