I have a main **project** with a subproject **tests**.
In **project/CMakeLists.txt** I added

```
add_subdirectory(tests)

```

In **project/tests/CMakeLists.txt** I plug in "pre-compiled" gtest library (from Ubuntu repository). I *cd* to /usr/src/gtest and compile two \*.a files into system lib directory.
And it works fine, until issue scribed in [google test FAQ](https://github.com/google/googletest/blob/master/googletest/docs/FAQ.md#why-is-it-not-recommended-to-install-a-pre-compiled-copy-of-google-test-for-example-into-usrlocal) appeared.

How to build gtest static library files from **project/tests/CMakeLists.txt** and how to use this new \*.a files instead of system ones?