1.cmake install

 tar zxvf cmake-3.6.1.tar.gz

 cd cmake-3.6.1

./bootstrap --prefix=/home/XX/publiclib/cmake

make&&make install

2.build gtest

unzip googletest-master.zip

cd googletest-master

mkdir build

cd build

cmake _Dgtest_build_samples=ON -DCMAKE_INSTALL_PREFIX=/data/home/XX/publiclib/gtest ../

make

make install