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})