Found it out eventually...
- git clone https://github.com/google/googletest.git -b release-1.11.0
- install mingw from MSYS2 (MinGW-w64 fails to compile std::mutex for reasons I forgot, but MSYS2 works flawless).
- add "C:\msys64\mingw64\bin" to your path.
- restart eclipse (so that it will find the gcc compiler)
- create new C++ project
- file - new - project
- C++ project
- empty project
- toolchain should show MinGW GCC as well, make sure to select that
Then open project properties
- added include paths to:
- googletest
- googletest/includes
- googlemock
- googlemock/includes
- added source location to:
- googletest/src
- googlemock/src
Now the last part took me long enough. After compiling, I got 1000+ link errors. This has something to do with the possibility to "fuse" googletest into your own code. For that purpose there is a file called
googletest/src/gtest-all.cc
This file includes all gtest source files in 1 source file. Since I just added the entire src folder as source location, I effectively compile the same source files twice, which obviously give the link errors.
So after deleting gtest-all.cc from disk, all works fine.