Skip to content

Commit

Permalink
Wait no way chat is this real
Browse files Browse the repository at this point in the history
  • Loading branch information
mcm001 committed Jan 11, 2025
1 parent b287f83 commit e196bfc
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
/install*
/.gradle
/gradleDir
toolchain
41 changes: 38 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,40 @@ set(CMAKE_OSX_ARCHITECTURES arm64 x86_64)
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT Embedded)
project(thirdparty-gtsam)

include(FetchContent)

# Fetch Eigen
set(EIGEN_BUILD_BLAS OFF)
set(EIGEN_BUILD_LAPACK OFF)
fetchcontent_declare(
Eigen3
GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git
GIT_TAG 0fb2ed140d4fc0108553ecfb25f2d7fc1a9319a1
GIT_PROGRESS TRUE
)
FetchContent_GetProperties(Eigen3)

if(NOT Eigen3_POPULATED)
FetchContent_Populate(Eigen3)

# Create a build directory for Eigen
set(eigen3_BUILD_DIR ${CMAKE_BINARY_DIR}/eigen3-build)
message("Eigen source is ${eigen3_SOURCE_DIR}, build is ${eigen3_BUILD_DIR}")
file(MAKE_DIRECTORY ${eigen3_BUILD_DIR})

# Configure Eigen
message("Hi configure - ${CMAKE_COMMAND} -S ${eigen3_SOURCE_DIR} -B ${eigen3_BUILD_DIR} -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/eigen-install")
execute_process(COMMAND ${CMAKE_COMMAND} -S ${eigen3_SOURCE_DIR} -B ${eigen3_BUILD_DIR} -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/eigen-install)

# Build and install Eigen
message("Hi install")
execute_process(COMMAND ${CMAKE_COMMAND} --build ${EIGEN_BUILD_DIR} --target install)
message("bye install")
endif()

# Set Eigen3_DIR to the installation location
set(Eigen3_DIR ${CMAKE_BINARY_DIR}/eigen-install/share/eigen3/cmake)

set(GTSAM_COMPILE_OPTIONS_PRIVATE_DEBUG CACHE INTERNAL FORCE)
set(GTSAM_COMPILE_OPTIONS_PRIVATE_RELWITHDEBINFO CACHE INTERNAL FORCE)
set(GTSAM_ENABLE_BOOST_SERIALIZATION OFF)
Expand All @@ -18,11 +52,12 @@ set(GTSAM_BUILD_TESTS OFF)
set(BUILD_SHARED_LIBS OFF)
set(GTSAM_FORCE_SHARED_LIB OFF)
set(GTSAM_FORCE_STATIC_LIB ON)
set(GTSAM_USE_SYSTEM_EIGEN ON)

include(FetchContent)
fetchcontent_declare(
gtsam
GIT_REPOSITORY https://github.com/mcm001/gtsam
GIT_TAG c24ca7951f1db4cfe4e23f368b2eda503de72176
GIT_REPOSITORY https://github.com/calcmogul/gtsam
GIT_TAG 79960095b9d8e03dd9ee83d7e0c9cab810a05a72
GIT_PROGRESS TRUE
)
fetchcontent_makeavailable(gtsam)
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# Third party gtsam
Third party gradle packaging for gtsam

## Updating thirdparty library version

Eigen is now a submodule here that we ask GTSAM to pull in using GTSAM_USE_SYSTEM_EIGEN. Change the submodule SHA to update Eigen.

0 comments on commit e196bfc

Please sign in to comment.