Quote all configure-expanded paths - Required when the paths may include whitespace or special characters. Change-Id: I573b4cabf5681bcbe7a545afe4acf9e9f61433e8
diff --git a/cmake/CeresConfig.cmake.in b/cmake/CeresConfig.cmake.in index 0ef7021..104e32d 100644 --- a/cmake/CeresConfig.cmake.in +++ b/cmake/CeresConfig.cmake.in
@@ -127,7 +127,7 @@ # install directory for this this file. This allows for the install # tree to be relocated, after Ceres was built, outside of CMake. get_filename_component(CURRENT_ROOT_INSTALL_DIR - ${CERES_CURRENT_CONFIG_DIR}/@INSTALL_ROOT_REL_CONFIG_INSTALL_DIR@ + "${CERES_CURRENT_CONFIG_DIR}/@INSTALL_ROOT_REL_CONFIG_INSTALL_DIR@" ABSOLUTE) if (NOT EXISTS ${CURRENT_ROOT_INSTALL_DIR}) ceres_report_not_found( @@ -142,7 +142,7 @@ # Ceres was exported from the build tree. set(CERES_EXPORTED_BUILD_DIR ${CERES_CURRENT_CONFIG_DIR}) get_filename_component(CERES_EXPORTED_SOURCE_DIR - ${CERES_EXPORTED_BUILD_DIR}/@INSTALL_ROOT_REL_CONFIG_INSTALL_DIR@ + "${CERES_EXPORTED_BUILD_DIR}/@INSTALL_ROOT_REL_CONFIG_INSTALL_DIR@" ABSOLUTE) if (NOT EXISTS ${CERES_EXPORTED_SOURCE_DIR}) ceres_report_not_found( @@ -170,10 +170,10 @@ set(EIGEN_WAS_BUILT_WITH_CMAKE @FOUND_INSTALLED_EIGEN_CMAKE_CONFIGURATION@) # Append the locations of Eigen when Ceres was built to the search path hints. if (EIGEN_WAS_BUILT_WITH_CMAKE) - set(Eigen3_DIR @Eigen3_DIR@) + set(Eigen3_DIR "@Eigen3_DIR@") set(EIGEN_PREFER_EXPORTED_EIGEN_CMAKE_CONFIGURATION TRUE) else() - list(APPEND EIGEN_INCLUDE_DIR_HINTS @EIGEN_INCLUDE_DIR@) + list(APPEND EIGEN_INCLUDE_DIR_HINTS "@EIGEN_INCLUDE_DIR@") endif() # Search quietly to control the timing of the error message if not found. The # search should be for an exact match, but for usability reasons do a soft @@ -219,11 +219,11 @@ # Append the locations of glog when Ceres was built to the search path hints. set(GLOG_WAS_BUILT_WITH_CMAKE @FOUND_INSTALLED_GLOG_CMAKE_CONFIGURATION@) if (GLOG_WAS_BUILT_WITH_CMAKE) - set(glog_DIR @glog_DIR@) + set(glog_DIR "@glog_DIR@") set(GLOG_PREFER_EXPORTED_GLOG_CMAKE_CONFIGURATION TRUE) else() - list(APPEND GLOG_INCLUDE_DIR_HINTS @GLOG_INCLUDE_DIR@) - get_filename_component(CERES_BUILD_GLOG_LIBRARY_DIR @GLOG_LIBRARY@ PATH) + 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}) endif() # Search quietly s/t we control the timing of the error message if not found. @@ -241,11 +241,11 @@ if (CERES_USES_GFLAGS) set(GFLAGS_WAS_BUILT_WITH_CMAKE @FOUND_INSTALLED_GFLAGS_CMAKE_CONFIGURATION@) if (GFLAGS_WAS_BUILT_WITH_CMAKE) - set(gflags_DIR @gflags_DIR@) + set(gflags_DIR "@gflags_DIR@") set(GFLAGS_PREFER_EXPORTED_GFLAGS_CMAKE_CONFIGURATION TRUE) else() - list(APPEND GFLAGS_INCLUDE_DIR_HINTS @GFLAGS_INCLUDE_DIR@) - get_filename_component(CERES_BUILD_GFLAGS_LIBRARY_DIR @GFLAGS_LIBRARY@ PATH) + list(APPEND GFLAGS_INCLUDE_DIR_HINTS "@GFLAGS_INCLUDE_DIR@") + get_filename_component(CERES_BUILD_GFLAGS_LIBRARY_DIR "@GFLAGS_LIBRARY@" PATH) list(APPEND GFLAGS_LIBRARY_DIR_HINTS ${CERES_BUILD_GFLAGS_LIBRARY_DIR}) endif() # Search quietly s/t we control the timing of the error message if not found.