Skip to content

Commit

Permalink
Updated Eigen dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
EmanueleGiacomini committed Jun 10, 2024
1 parent 074da52 commit 815b5d5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 21 deletions.
28 changes: 10 additions & 18 deletions mad_icp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,21 @@ option(COMPILE_CPP_APPS "Set to ON to compile C++ applications" OFF)

# Eigen
# TODO: Detect if Eigen exists in system, oterwhise, download it through FetchContent
find_package(Eigen3 3.3 NO_MODULE)

# find_package(Eigen3 3.3 NO_MODULE)
if(NOT DEFINED Eigen3_FOUND)
message(CHECK_START "Fetching Eigen3")
list(APPEND CMAKE_MESSAGE_INDENT " ")

include(FetchContent)
FetchContent_Declare(
Eigen
GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git
GIT_TAG master
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE)

# note: To disable eigen tests,
# you should put this code in a add_subdirectory to avoid to change
# BUILD_TESTING for your own project too since variables are directory
# scoped
set(BUILD_TESTING OFF)
set(EIGEN_BUILD_TESTING OFF)
set(EIGEN_MPL2_ONLY ON)
set(EIGEN_BUILD_PKGCONFIG OFF)
set(EIGEN_BUILD_DOC OFF)
FetchContent_MakeAvailable(Eigen)
URL https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.gz)
FetchContent_GetProperties(Eigen)

if(NOT eigen_POPULATED)
FetchContent_Populate(Eigen)
add_subdirectory(${eigen_SOURCE_DIR} ${eigen_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()

list(POP_BACK CMAKE_MESSAGE_INDENT)
message(CHECK_PASS "fetched")
Expand All @@ -52,7 +43,8 @@ find_package(pybind11 REQUIRED)

include_directories(
${PROJECT_SOURCE_DIR}/src
${EIGEN3_INCLUDE_DIR}

# ${EIGEN3_INCLUDE_DIR}
${PYTHON_INCLUDE_DIRS}
)

Expand Down
2 changes: 1 addition & 1 deletion mad_icp/src/odometry/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ add_library(odometry STATIC

target_link_libraries(odometry
tools
Eigen3::Eigen
)

target_compile_features(odometry PUBLIC)
1 change: 1 addition & 0 deletions mad_icp/src/pybind/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
pybind11_add_module(pypeline MODULE pypeline.cpp)
target_link_libraries(pypeline PRIVATE
Eigen3::Eigen
odometry
tools
)
Expand Down
3 changes: 1 addition & 2 deletions mad_icp/src/tools/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
add_library(tools STATIC
mad_tree.cpp
)

target_link_libraries(tools)
target_link_libraries(tools PUBLIC Eigen3::Eigen)
target_compile_features(tools PUBLIC)

0 comments on commit 815b5d5

Please sign in to comment.