Add additional search paths for glog & Eigen on Windows.
- When built with CMake on Windows, the default install prefix
will be C:/Program Files/<PROJECT_NAME> (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
diff --git a/cmake/FindEigen.cmake b/cmake/FindEigen.cmake
index d45fad7..cdeb305 100644
--- a/cmake/FindEigen.cmake
+++ b/cmake/FindEigen.cmake
@@ -91,8 +91,6 @@
# 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 @@
# 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 3411685..d7af064 100644
--- a/cmake/FindGlog.cmake
+++ b/cmake/FindGlog.cmake
@@ -225,7 +225,9 @@
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 @@
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