I'm trying to install a library which relies on Eigen library. The error I'm getting in Windows 10 using Cmake 3.23.0-rc2. I'm getting this
CMake Error at CMakeLists.txt:25 (FIND_PACKAGE):
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.
There are no Eigen3Config.cmake
eigen3-config.cmake
in Eigen library I'm using version 3.2.4. Since this is a header-only library, I didn't do any configuration in Windows 10. Some people suggest to add this line
list(APPEND CMAKE_MODULE_PATH "<path to eigen>/cmake")
But it didn't solve my problem. This is the part in CMakeLists.txt
CMAKE_MINIMUM_REQUIRED(VERSION 3.4)
if(WIN32)
ADD_DEFINITIONS(-D_USE_MATH_DEFINES)
FIND_PACKAGE(Eigen3 CONFIG REQUIRED)
INCLUDE_DIRECTORIES(${EIGEN3_INCLUDE_DIR})
endif()
Adding path to the Eigen folder didn't solve the problem.