Small Bug in FindGoogleTest when using GTEST_ROOT environment variable
So I was having a bit of trouble using FindGTest earlier today in that it could locate GTEST_INCLUDE_DIR but it couldn't find GTEST_LIBRARY or GTEST_MAIN_LIBRARY. I was setting the location of GTEST_ROOT using an environment variable. Digging into FindGTest.cmake I found this
function(__gtest_find_library _name)
find_library(${_name}
NAMES ${ARGN}
HINTS
ENV GTEST_ROOT # PROBLEM IS HERE
${GTEST_ROOT}
PATH_SUFFIXES ${_gtest_libpath_suffixes}
)
mark_as_advanced(${_name})
endfunction()
It has just ENV GTEST_ROOT
when it should be $ENV{GTEST_ROOT}
or else this is a new use of ENV that I have not seen before. Making my suggested change on my local version of FindGTest.cmake did fix the problem of not being able to locate the libraries