From 531ecb4000c6f3f42a9641088b902503af4d9c08 Mon Sep 17 00:00:00 2001 From: Abe Date: Mon, 9 Mar 2015 17:01:47 -0700 Subject: [PATCH] Get rid of hardcoded path to the internal version of eigen inside gtsam --- CMakeLists.txt | 13 ++++++++++--- gtsam/base/Matrix.cpp | 4 ++-- gtsam/base/Matrix.h | 6 +++--- gtsam/base/OptionalJacobian.h | 2 +- gtsam/base/Vector.h | 2 +- 5 files changed, 17 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 38ee89760..0041c4710 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -196,8 +196,7 @@ endif() ### See: http://eigen.tuxfamily.org/bz/show_bug.cgi?id=704 (Householder QR MKL selection) ### http://eigen.tuxfamily.org/bz/show_bug.cgi?id=705 (Fix MKL LLT return code) ### http://eigen.tuxfamily.org/bz/show_bug.cgi?id=716 (Improved comma initialization) -# option(GTSAM_USE_SYSTEM_EIGEN "Find and use system-installed Eigen. If 'off', use the one bundled with GTSAM" OFF) -set(GTSAM_USE_SYSTEM_EIGEN OFF) +option(GTSAM_USE_SYSTEM_EIGEN "Find and use system-installed Eigen. If 'off', use the one bundled with GTSAM" OFF) # Switch for using system Eigen or GTSAM-bundled Eigen if(GTSAM_USE_SYSTEM_EIGEN) @@ -207,13 +206,16 @@ if(GTSAM_USE_SYSTEM_EIGEN) find_package(Eigen3 REQUIRED) include_directories(AFTER "${EIGEN3_INCLUDE_DIR}") else() - # Use bundled Eigen include paths e.g. + # Use bundled Eigen include path. set(GTSAM_EIGEN_INCLUDE_PREFIX "gtsam/3rdparty/Eigen/") # Clear any variables set by FindEigen3 if(EIGEN3_INCLUDE_DIR) set(EIGEN3_INCLUDE_DIR NOTFOUND CACHE STRING "" FORCE) endif() + # Add the bundled version of eigen to the include path so that it can still be included + # with #include + include_directories(BEFORE ${GTSAM_EIGEN_INCLUDE_PREFIX}) endif() # Write Eigen include file with the paths for either the system Eigen or the GTSAM-bundled Eigen @@ -389,6 +391,11 @@ if(NOT MSVC AND NOT XCODE_VERSION) message(STATUS " C compilation flags : ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${cmake_build_type_toupper}}") message(STATUS " C++ compilation flags : ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${cmake_build_type_toupper}}") endif() +if(GTSAM_USE_SYSTEM_EIGEN) + message(STATUS " Use System Eigen : Yes") +else() + message(STATUS " Use System Eigen : No") +endif() if(GTSAM_USE_TBB) message(STATUS " Use Intel TBB : Yes") elseif(TBB_FOUND) diff --git a/gtsam/base/Matrix.cpp b/gtsam/base/Matrix.cpp index 7fa0992ca..a5836a3ac 100644 --- a/gtsam/base/Matrix.cpp +++ b/gtsam/base/Matrix.cpp @@ -20,8 +20,8 @@ #include #include #include -#include -#include +#include +#include #include #include diff --git a/gtsam/base/Matrix.h b/gtsam/base/Matrix.h index 27b7ec8f7..53b040b9a 100644 --- a/gtsam/base/Matrix.h +++ b/gtsam/base/Matrix.h @@ -23,9 +23,9 @@ #pragma once #include #include -#include -#include -#include +#include +#include +#include #include #include diff --git a/gtsam/base/OptionalJacobian.h b/gtsam/base/OptionalJacobian.h index 2ea9d672e..81bf265a3 100644 --- a/gtsam/base/OptionalJacobian.h +++ b/gtsam/base/OptionalJacobian.h @@ -19,7 +19,7 @@ #pragma once -#include +#include #ifndef OPTIONALJACOBIAN_NOBOOST #include diff --git a/gtsam/base/Vector.h b/gtsam/base/Vector.h index fc543acc3..0869abc16 100644 --- a/gtsam/base/Vector.h +++ b/gtsam/base/Vector.h @@ -26,7 +26,7 @@ #endif #include -#include +#include #include #include