title: CMake - Eigen3_DIR-NOTFOUND
body: <p>I am trying to build a project with CMake on Windows 10. But I keep getting this error for hours:</p>
  <h3>Error:</h3>
  <pre><code>  CMake Error at of_dis/CMakeLists.txt:8 (FIND_PACKAGE):
    By not providing &quot;FindEigen3.cmake&quot; in CMAKE_MODULE_PATH this project has
    asked CMake to find a package configuration file provided by &quot;Eigen3&quot;, but
    CMake did not find one.
  
    Could not find a package configuration file provided by &quot;Eigen3&quot; with any
    of the following names:
  
      Eigen3Config.cmake
      eigen3-config.cmake
  
    Add the installation prefix of &quot;Eigen3&quot; to CMAKE_PREFIX_PATH or set
    &quot;Eigen3_DIR&quot; to a directory containing one of the above files.  If &quot;Eigen3&quot;
    provides a separate development package or SDK, be sure it has been
    installed.
  </code></pre>
  <p>I downloaded Eigen, extracted it, and added a new Environment variable called <code>EIGEN3_INCLUDE_DIR</code> with value <code>C:\eigen-3.3.7\cmake</code>. Also, I added a line to the CMake file of the project which now looks like this:</p>
  <h3>CMakeLists.txt:</h3>
  <pre class="lang-c prettyprint-override"><code>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 ( &quot;$ENV{EIGEN3_INCLUDE_DIR}&quot; )
  
  set(CMAKE_CXX_STANDARD 11)
  
  #set(OpenCV_DIR &quot;C:/opencv/opencv3.4.1/opencv-3.4.1/build/install&quot;)
  set(OpenCV_DIR &quot;C:/opencv/opencv3.4.1/opencv-3.4.1/build/install/x64/vc14/lib&quot;)
  
  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})
  </code></pre>
  <h3>CMake GUI:</h3>
  <p><a href="https://i.stack.imgur.com/6o1TA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6o1TA.png" alt="enter image description here" /></a></p>
  <p>I also copied the <code>FindEigen3.cmake</code> file in my current project.
  But I am still getting the same error over and over again. Is there a way to fix this?</p>