The global variable gtest_SOURCE_DIR is replaced by CMake when fetch-content is used with the name "GTest" and points to the root directory. The include directories from the gtest target are always valid.