Skip to content

Commit

Permalink
Update to new Eigen build system (#514)
Browse files Browse the repository at this point in the history
  • Loading branch information
calcmogul authored May 1, 2024
1 parent 9bac50e commit 5aa27bd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 48 deletions.
19 changes: 3 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,12 @@ target_link_libraries(Sleipnir PUBLIC Threads::Threads)

# Eigen dependency
if(NOT USE_SYSTEM_EIGEN)
set(EIGEN_BUILD_CMAKE_PACKAGE TRUE)
fetchcontent_declare(
Eigen3
GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git
# master on 2024-04-02
GIT_TAG 86aee3d9c5b0ea73f7854901c1ce216135f1228b
PATCH_COMMAND
git apply
${CMAKE_CURRENT_SOURCE_DIR}/cmake/eigen-disable-fortran-support.patch
UPDATE_DISCONNECTED 1
# master on 2024-05-01
GIT_TAG 9700fc847a39e98dfb7bd85331b5206641050e04
)
fetchcontent_makeavailable(Eigen3)
else()
Expand All @@ -118,16 +115,6 @@ endif()

target_link_libraries(Sleipnir PUBLIC Eigen3::Eigen)

# Prevent Eigen tests from running
add_custom_command(
TARGET Sleipnir
PRE_BUILD
COMMAND
${CMAKE_COMMAND} -E rm -f
${CMAKE_BINARY_DIR}/_deps/eigen3-build/CTestTestfile.cmake
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)

# fmt dependency
if(NOT USE_SYSTEM_FMT)
fetchcontent_declare(
Expand Down
31 changes: 0 additions & 31 deletions cmake/eigen-disable-fortran-support.patch

This file was deleted.

3 changes: 2 additions & 1 deletion cmake/modules/Pybind11Mkdoc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ function(pybind11_mkdoc target headers)
get_target_property(target_dirs ${target} INCLUDE_DIRECTORIES)
list(TRANSFORM target_dirs PREPEND "-I")

get_target_property(eigen_dirs Eigen3::Eigen INCLUDE_DIRECTORIES)
get_target_property(eigen_dirs Eigen3::Eigen INTERFACE_INCLUDE_DIRECTORIES)
list(FILTER eigen_dirs INCLUDE REGEX "\\$<BUILD_INTERFACE:.*>")
list(TRANSFORM eigen_dirs PREPEND "-I")

add_custom_command(
Expand Down

0 comments on commit 5aa27bd

Please sign in to comment.