find_package does not find GTest which is part of CMake
c++, cmake, googletest
Solution
`find_package` does not look in CMake's installation directory. It only evaluates the `PATH` and `CMAKE_PREFIX_VARIABLES`. Just add the path to CMake's GTest to the latter variable, clear your CMake cache and re-run CMake.
Problem
I want to find `GTest` via: ``` find_package(GTest REQUIRED) ``` But it is not found: Error:Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY) I know from this link that `GTest` should be distributed via standard CMake. Can you tell me what I did wrong?