Question: Debian does not provide any precompiled packages for gTest anymore. They suggest you integrate the framework into your project's makefile. But I want to keep my makefile clean. How do I set up gTest like the former versions (<1.6.0), so that I can link against the library?

Answer: 
If you happen to be using CMake, you can use [`ExternalProject_Add`](http://www.cmake.org/cmake/help/v2.8.10/cmake.html#module:ExternalProject) as described [here](https://stackoverflow.com/a/9695234/424459).

This avoids you having to keep gtest source code in your repository, or installing it anywhere. It is downloaded and built in your build tree automatically.
This will install google test and mock library in Ubuntu/Debian based system:

```
sudo apt-get install google-mock

```

Tested in google cloud in debian based image.