GTEST_INCLUDE_DIRS not set after find_package(GTest REQUIRED)

Viewed 157

I am running CMake 3.20.2 on Mac Catalina. I have built gtest and installed it on the system with sudo make install. gtest exists in /usr/include. But when I run cmake lines: find_package(GTest REQUIRED) GTEST_FOUND is true but GTEST_INCLUDE_DIRS is not set. Under what circumstances doe GTEST_INCLUDE_DIRS either get set or not by the call to find_package? The CMake docs say these should be set as result variables but only one seems to be set.

1 Answers

In your CmakeLists.txt, add include_directories("GTEST_INCLUDE_DIRS")

Related