From d4d2d0d8ade27224e0777b6bf2b659ab2973c6ed Mon Sep 17 00:00:00 2001 From: leonarski_f Date: Sat, 20 Jun 2026 13:38:46 +0200 Subject: [PATCH] CMake: fix CI -- export vendored Eigen so Ceres' install(EXPORT) resolves A clean configure failed at generation: install(EXPORT "CeresExport" ...) includes target "ceres" which requires target "eigen" that is not in any export set. Ceres' install(EXPORT CeresExport) is unconditional, and its ceres target transitively links the eigen target. As a FetchContent subproject Eigen leaves EIGEN_BUILD_CMAKE_PACKAGE OFF (it defaults to PROJECT_IS_TOP_LEVEL), so its install(EXPORT Eigen3Targets) never runs and eigen ends up in no installed export set. Force EIGEN_BUILD_CMAKE_PACKAGE ON so eigen is exported and Ceres' export validates. Install/export-only change; the build is unaffected. Verified with a clean configure (fresh CMakeCache): configure + generate now succeed where they previously errored. Co-Authored-By: Claude Opus 4.8 --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) 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