From adb5f8e92c9f2df2746e94bca20060a62f9e64ba Mon Sep 17 00:00:00 2001 From: Alex Stewart Date: Mon, 2 Jan 2017 13:44:29 +0000 Subject: [PATCH] Add additional search paths for glog & Eigen on Windows. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - When built with CMake on Windows, the default install prefix will be C:/Program Files/ (instead of /usr/local on Linux / OS X. - Due to an upstream change in Eigen >= 3.3, the project name for Eigen changed to Eigen3 from Eigen, thus changing the default install location. - glog, uses the project name “google-glog”, thus when it is build with CMake, this becomes it’s default install path instead of just glog when built with other tools. - This patch adds both of these paths to the default search list on Windows. Change-Id: I987b502fed0f6e685c504fd47fd504307aad8bef --- cmake/FindEigen.cmake | 5 ++--- cmake/FindGlog.cmake | 8 ++++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/cmake/FindEigen.cmake b/cmake/FindEigen.cmake index d45fad7c9..cdeb30557 100644 --- a/cmake/FindEigen.cmake +++ b/cmake/FindEigen.cmake @@ -91,8 +91,6 @@ unset(EIGEN_FOUND) # Search user-installed locations first, so that we prefer user installs # to system installs where both exist. -# -# TODO: Add standard Windows search locations for Eigen. list(APPEND EIGEN_CHECK_INCLUDE_DIRS /usr/local/include /usr/local/homebrew/include # Mac OS X @@ -102,7 +100,8 @@ list(APPEND EIGEN_CHECK_INCLUDE_DIRS # Additional suffixes to try appending to each search path. list(APPEND EIGEN_CHECK_PATH_SUFFIXES eigen3 # Default root directory for Eigen. - Eigen/include/eigen3 ) # Windows (for C:/Program Files prefix). + Eigen/include/eigen3 # Windows (for C:/Program Files prefix) < 3.3 + Eigen3/include/eigen3 ) # Windows (for C:/Program Files prefix) >= 3.3 # Search supplied hint directories first if supplied. find_path(EIGEN_INCLUDE_DIR diff --git a/cmake/FindGlog.cmake b/cmake/FindGlog.cmake index 341168566..d7af064b3 100644 --- a/cmake/FindGlog.cmake +++ b/cmake/FindGlog.cmake @@ -225,7 +225,9 @@ if (NOT GLOG_FOUND) glog/include glog/Include Glog/include - Glog/Include) + Glog/Include + google-glog/include # CMake installs with project name prefix. + google-glog/Include) list(APPEND GLOG_CHECK_LIBRARY_DIRS /usr/local/lib @@ -237,7 +239,9 @@ if (NOT GLOG_FOUND) glog/lib glog/Lib Glog/lib - Glog/Lib) + Glog/Lib + google-glog/lib # CMake installs with project name prefix. + google-glog/Lib) # Search supplied hint directories first if supplied. find_path(GLOG_INCLUDE_DIR