【发布时间】:2020-03-09 04:41:04
【问题描述】:
当我在 CMakeLists.txt 文件中配置 Eigen 库时:
cmake_minimum_required(VERSION 3.14)
project(helloworld)
add_subdirectory(tests)
add_subdirectory(deps/eigen)
set(SRC_LIST main.cpp)
add_executable(hello ${SRC_LIST})
find_package(Eigen3 3.3 REQUIRED NO_MODULE)
target_link_libraries(hello eigen)
我得到了 cmake 错误
CMake Error at build/deps/eigen/Eigen3Config.cmake:20 (include):
The file
/Users/joe/codecplus/build/deps/eigen/Eigen3Targets.cmake
was generated by the export() command. It may not be used as the argument
to the include() command. Use ALIAS targets instead to refer to targets by
alternative names.
Call Stack (most recent call first):
CMakeLists.txt:9 (find_package)
谁能帮帮我?不知道这里出了什么问题。非常感谢。
【问题讨论】: