1. Install the CMake, the specific steps here is unknown.
2. Download Source: https://codeload.github.com/google/googletest/zip/release-1.8.0
3. Decompression Source:unzip Googletest-release-1.8.0.zip
4. Enter the source directory:CD googletest-release-1.8.0
5. Create and enter directory Build:mkdir build && CD Build
6. Compiling:cmake. && Make
7. Copy the generated libgtest.a and libgtest_main.ato/usr/local/lib/down
sudo cp libgtest.a libgtest_main.a/usr/local/lib/
8. Copy the Gtest folder in the include to the/usr/local/include
CD googletest-release-1.8.0
sudo cp-rf include/*/usr/local/include/
9. Using Gtest
Write a Test.cpp
g++-O test test.cpp-lgtest-lgtest_main-lpthread
You do not need to specify a path here because:
/usr/local/lib path, existing in/etc/ld.so.conf
/usr/local/include path, existing in/etc/profile
Linux Gtest Installation