From fcbbb11e37386097b1427dc3aa89f264d6951ded Mon Sep 17 00:00:00 2001 From: Alex Stewart Date: Wed, 13 Nov 2013 22:22:30 +0000 Subject: [PATCH] Ensure build paths for dependencies are searched in FindPackage(Ceres) - Append to hint locations used by FindPackage scripts for public dependencies (glog & Eigen) the locations of the dependencies when Ceres was built. - This means that the user should not have to supply them again when using find_package(Ceres) even if they are installed in a non-standard location. Change-Id: I9550de91025ba47f01f1ea3c3fefe80fe38d14ff --- cmake/CeresConfig.cmake.in | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmake/CeresConfig.cmake.in b/cmake/CeresConfig.cmake.in index 604470020..1a3365665 100644 --- a/cmake/CeresConfig.cmake.in +++ b/cmake/CeresConfig.cmake.in @@ -126,6 +126,8 @@ SET(CERES_INCLUDE_DIRS ${CERES_INCLUDE_DIR}) # Eigen. # Flag set during configuration and build of Ceres. SET(CERES_EIGEN_VERSION @EIGEN_VERSION@) +# Append the locations of Eigen when Ceres was built to the search path hints. +LIST(APPEND EIGEN_INCLUDE_DIR_HINTS @EIGEN_INCLUDE_DIR@) # Search quietly s/t we control the timing of the error message if not found. FIND_PACKAGE(Eigen ${CERES_EIGEN_VERSION} EXACT QUIET) IF (EIGEN_FOUND) @@ -141,6 +143,10 @@ LIST(APPEND CERES_INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS}) # Glog. # Flag set during configuration and build of Ceres. SET(CERES_USES_MINIGLOG @MINIGLOG@) +# Append the locations of glog when Ceres was built to the search path hints. +LIST(APPEND GLOG_INCLUDE_DIR_HINTS @GLOG_INCLUDE_DIR@) +GET_FILENAME_COMPONENT(CERES_BUILD_GLOG_LIBRARY_DIR @GLOG_LIBRARY@ PATH) +LIST(APPEND GLOG_LIBRARY_DIR_HINTS ${CERES_BUILD_GLOG_LIBRARY_DIR}) IF (CERES_USES_MINIGLOG) SET(MINIGLOG_INCLUDE_DIR ${CERES_INCLUDE_DIR}/ceres/internal/miniglog) IF (NOT EXISTS ${MINIGLOG_INCLUDE_DIR})