The eigen/ directory was a byte-identical copy of upstream libeigen/eigen tag 3.4.0 (commit 3147391d, the same release libCZI pins in cmake/ExternalEIGEN3.cmake). Replace the copy with a shallow git submodule (.gitmodules: shallow = true) for verifiable provenance and smaller fork. The Eigen3::Eigen interface config moves to eigen-cfg/Eigen3Config.cmake (the Eigen repo only ships the Eigen3Config.cmake.in template), and build.rs points Eigen3_DIR there.
25 lines
1.2 KiB
CMake
25 lines
1.2 KiB
CMake
# SPDX-License-Identifier: MPL-2.0
|
|
#
|
|
# CMake package interface for the Eigen submodule (eigen/), pinned at the
|
|
# official tag 3.4.0 (commit
|
|
# 3147391d946bb4b6c68edd901f2add6ac1f31f8c - the exact release libCZI pins in
|
|
# its cmake/ExternalEIGEN3.cmake). The Eigen release tree only ships the
|
|
# template cmake/Eigen3Config.cmake.in, which is expanded by Eigen's own CMake
|
|
# build (deliberately skipped by libCZI), so this small config provides the
|
|
# Eigen3::Eigen interface target used via
|
|
# find_package(Eigen3 REQUIRED NO_MODULE)
|
|
# with LIBCZI_BUILD_PREFER_EXTERNALPACKAGE_EIGEN3=ON.
|
|
#
|
|
# Eigen is header-only (MPL-2.0; see COPYING.MPL2 in the submodule) and the
|
|
# submodule is checked out shallow (see .gitmodules), so libczirw-sys builds
|
|
# need neither network access during the build (libCZI's default Eigen
|
|
# ExternalProject clone from gitlab.com is flaky in CI), a full eigen git
|
|
# history, nor a system libeigen3-dev package.
|
|
if(NOT TARGET Eigen3::Eigen)
|
|
get_filename_component(_eigen3_root "${CMAKE_CURRENT_LIST_DIR}/../eigen" ABSOLUTE)
|
|
add_library(Eigen3::Eigen INTERFACE IMPORTED GLOBAL)
|
|
set_target_properties(Eigen3::Eigen PROPERTIES
|
|
INTERFACE_INCLUDE_DIRECTORIES "${_eigen3_root}")
|
|
set(EIGEN3_INCLUDE_DIR "${_eigen3_root}")
|
|
endif()
|