From 5de77f399e020cdcff9efddec51a75b5f3358f9a Mon Sep 17 00:00:00 2001 From: Alex Stewart Date: Wed, 22 Jun 2022 19:20:40 +0100 Subject: [PATCH] Fix reporting of METIS version - Also fixes behaviour of EIGENMETIS option to match that of the other CMake dependency options, and ensure that its value aligns exactly with whether Eigen support for METIS will be compiled into Ceres. Change-Id: Ifbf6f5d82b9ba89a156673eb6042519a985e6b04 --- CMakeLists.txt | 11 +++++++---- internal/ceres/solver_utils.cc | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f0d86f51f..8d6094c36 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -311,12 +311,15 @@ if (EIGENMETIS) install(FILES ${Ceres_SOURCE_DIR}/cmake/FindMETIS.cmake DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR}) endif (NOT METIS_DIR) + else (METIS_FOUND) + message("-- Did not find METIS, disabling Eigen METIS support.") + update_cache_variable(EIGENMETIS OFF) + list (APPEND CERES_COMPILE_OPTIONS CERES_NO_EIGEN_METIS) endif (METIS_FOUND) -endif (EIGENMETIS) - -if (NOT EIGENMETIS OR NOT METIS_FOUND) +else (EIGENMETIS) + message("-- Building without Eigen METIS support.") list (APPEND CERES_COMPILE_OPTIONS CERES_NO_EIGEN_METIS) -endif (NOT EIGENMETIS OR NOT METIS_FOUND) +endif (EIGENMETIS) if (ACCELERATESPARSE) find_package(AccelerateSparse) diff --git a/internal/ceres/solver_utils.cc b/internal/ceres/solver_utils.cc index 7cf1f3296..4c4a354ae 100644 --- a/internal/ceres/solver_utils.cc +++ b/internal/ceres/solver_utils.cc @@ -62,7 +62,7 @@ constexpr char kVersion[] = "-suitesparse-(" CERES_SUITESPARSE_VERSION ")" #endif -#ifndef CERES_NO_EIGEN_METIS +#if !defined(CERES_NO_EIGEN_METIS) || !defined(CERES_NO_CHOLMOD_PARTITION) "-metis-(" CERES_METIS_VERSION ")" #endif