CMake: fix CI -- export vendored Eigen so Ceres' install(EXPORT) resolves
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 13m49s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 14m22s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 14m32s
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 14m37s
Build Packages / build:rpm (rocky8) (push) Successful in 14m30s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 14m38s
Build Packages / build:rpm (rocky9_sls9) (push) Successful in 15m11s
Build Packages / XDS test (durin plugin) (push) Successful in 7m49s
Build Packages / XDS test (JFJoch plugin) (push) Successful in 8m5s
Build Packages / Generate python client (push) Successful in 27s
Build Packages / Create release (push) Skipped
Build Packages / Build documentation (push) Successful in 1m5s
Build Packages / XDS test (neggia plugin) (push) Successful in 9m8s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 10m52s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 11m12s
Build Packages / build:rpm (rocky9) (push) Successful in 12m34s
Build Packages / DIALS test (push) Successful in 12m37s
Build Packages / Unit tests (push) Successful in 58m0s

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 <noreply@anthropic.com>
This commit is contained in:
2026-06-20 13:38:46 +02:00
parent cd394c5249
commit d4d2d0d8ad
+5
View File
@@ -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