Fixing gflags HINTS variable names (adding missing “_DIR”).
- The HINTS variables for gflags were incorrectly used as
GFLAGS_[INCLUDE/LIBRARY]_HINTS when they should have been
GFLAGS_[INCLUDE/LIBRARY]_DIR_HINTS as per the docs.
- Also removing a completed TODO in the main CMakeLists.
- Updating method of extracting current directory in CeresConfig.cmake
to avoid use of CMAKE_CURRENT_LIST_DIR, which was not present in
CMake =< v2.8.3.
Change-Id: I42ae696e3b785febe48688d912f0f343e8947cb0
diff --git a/cmake/CeresConfig.cmake.in b/cmake/CeresConfig.cmake.in
index 64eaf9c..25218d5 100644
--- a/cmake/CeresConfig.cmake.in
+++ b/cmake/CeresConfig.cmake.in
@@ -77,7 +77,8 @@
ENDMACRO(CERES_REPORT_NOT_FOUND)
# Get the (current, i.e. installed) directory containing this file.
-SET(CURRENT_CONFIG_INSTALL_DIR ${CMAKE_CURRENT_LIST_DIR})
+GET_FILENAME_COMPONENT(CURRENT_CONFIG_INSTALL_DIR
+ "${CMAKE_CURRENT_LIST_FILE}" PATH)
# Record the state of the CMake module path when this script was called so
# that we can ensure that we leave it in the same state on exit as it was
diff --git a/cmake/FindGflags.cmake b/cmake/FindGflags.cmake
index 1148d03..af50220 100644
--- a/cmake/FindGflags.cmake
+++ b/cmake/FindGflags.cmake
@@ -103,7 +103,7 @@
# Search supplied hint directories first if supplied.
FIND_PATH(GFLAGS_INCLUDE_DIR
NAMES gflags/gflags.h
- PATHS ${GFLAGS_INCLUDE_HINTS}
+ PATHS ${GFLAGS_INCLUDE_DIR_HINTS}
${GFLAGS_CHECK_INCLUDE_DIRS})
IF (NOT GFLAGS_INCLUDE_DIR OR
NOT EXISTS ${GFLAGS_INCLUDE_DIR})
@@ -114,7 +114,7 @@
NOT EXISTS ${GFLAGS_INCLUDE_DIR})
FIND_LIBRARY(GFLAGS_LIBRARY NAMES gflags
- PATHS ${GFLAGS_LIBRARY_HINTS}
+ PATHS ${GFLAGS_LIBRARY_DIR_HINTS}
${GFLAGS_CHECK_LIBRARY_DIRS})
IF (NOT GFLAGS_LIBRARY OR
NOT EXISTS ${GFLAGS_LIBRARY})