本文首发于个人博客https://kezunlin.me/post/4a1427cf/,欢迎阅读!
compile gtest on ubuntu 16.04
Guide
apt-get
sudo apt-get install libgtest-dev
cd /usr/src/gtest # only source files
compile
git clone https://github.com/google/googletest.git
wget https://github.com/google/googletest/archive/release-1.8.0.tar.gz
cd googletest
mkdir build
cd build
cmake-gui ..
make -j8
sudo make install
options:
BUILD_SHARED_LIBS=ON
install to
/usr/local/
- for static library, we use
libgtest.a
- for shared library, use use
ligbtest.so
.