I am trying to build a project with CMake on Windows 10. But I keep getting this error for hours:
Error:
CMake Error at of_dis/CMakeLists.txt:8 (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.
I downloaded Eigen, extracted it, and added a new Environment variable called EIGEN3_INCLUDE_DIR
with value C:\eigen-3.3.7\cmake
. Also, I added a line to the CMake file of the project which now looks like this:
CMakeLists.txt:
cmake_minimum_required(VERSION 2.8)
project(IMOT_OpticalFlow_Edges)
find_package(OpenCV REQUIRED)
add_subdirectory(of_dis)
include_directories(./of_dis ${OpenCV_INCLUDE_DIRS})
INCLUDE_DIRECTORIES ( "$ENV{EIGEN3_INCLUDE_DIR}" )
set(CMAKE_CXX_STANDARD 11)
#set(OpenCV_DIR "C:/opencv/opencv3.4.1/opencv-3.4.1/build/install")
set(OpenCV_DIR "C:/opencv/opencv3.4.1/opencv-3.4.1/build/install/x64/vc14/lib")
set(SOURCE_FILES src/main.cpp src/support/Place.cpp src/support/Line.cpp src/support/Argument.cpp
src/support/FileOperations.cpp src/frame_processing/FrameProcessor.cpp src/flow_processing/FlowProcessor.cpp
src/edge_processing/EdgeProcessor.cpp src/detection/Detector.cpp)
add_executable(IMOT_OpticalFlow_Edges ${SOURCE_FILES})
target_link_libraries(IMOT_OpticalFlow_Edges ${OpenCV_LIBS})
CMake GUI:
I also copied the FindEigen3.cmake
file in my current project.
But I am still getting the same error over and over again. Is there a way to fix this?