diff --git a/CMakeLists.txt b/CMakeLists.txt index 366e86f9..fdaa5546 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -221,6 +221,11 @@ ADD_COMPILE_DEFINITIONS(JFJOCH_USE_FFTW) SET(EIGEN_BUILD_DOC OFF CACHE BOOL "" FORCE) SET(EIGEN_BUILD_TESTING OFF CACHE BOOL "" FORCE) SET(EIGEN_BUILD_PKGCONFIG OFF CACHE BOOL "" FORCE) +# Ceres' install(EXPORT CeresExport) is unconditional and its ceres target transitively links the +# eigen target, so eigen must live in an installed export set or generation fails ("eigen is not in +# any export set"). As a subproject Eigen defaults EIGEN_BUILD_CMAKE_PACKAGE OFF, which skips its +# install(EXPORT Eigen3Targets); force it ON so eigen is exported and Ceres' export resolves. +SET(EIGEN_BUILD_CMAKE_PACKAGE ON CACHE BOOL "" FORCE) FetchContent_Declare(Eigen3 GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git GIT_TAG 5.0.1