Open nrbrook opened 5 years ago
Yes, I can see this could cause a problem. What do you suggest we do to solve this?
The simple solution would be just to rename the directory, perhaps to lib/gtest
. In my projects I use CMake which can download googletest during configuration. Alternatively googletest could be added as a git submodule. As the googletest used here is quite old there may be compatibility issues when updating.
This is how i solved this in my CMake file:
FetchContent_Declare(fff
GIT_REPOSITORY https://github.com/meekrosoft/fff.git
GIT_TAG v1.1)
FetchContent_GetProperties(fff)
if(NOT fff_POPULATED)
FetchContent_Populate(fff)
file(REMOVE_RECURSE ${fff_SOURCE_DIR}/gtest)
endif()
+1 to this
Describe the bug Because gtest is embedded in the root of the respository under the gtest directory, if this repository is included in a unit testing
CMakeLists.txt
usinginclude_directories
, and googletest is also used in the same project then#include "gtest/gtest.h"
could include either header. As the gtest.h in this project is very old, this causes problems.To Reproduce Steps to reproduce the behavior:
gtest/gtest.h