GoogleTest installation at the APC2017 School


These quick instructions are meant to facilitate the installation of GoogleTest on the APC2017 students' laptops. They do not replace the more extensive instructions available in GoogleTest documentation.

red77.gif Create a directory where googletest will be installed and define an associated environment variable:

mkdir $HOME/Documents/g4dev/googletest
setenv GTESTPATH $HOME/Documents/g4dev/googletest/gtest_install

red77.gif Create include/ and lib/ directories within it:

mkdir $GTESTPATH/include
mkdir $GTTEST/INSTALL/lib

red77.gif Download googletest stable release (1.7.0 was installed for APC 2016)

red77.gif Unzip/untar what you downloaded and go into the googletest release directory:

tar -xvzf gtest-1.7.0.tar.gz
unzip gtest-1.7.0.zip
cd $HOME/Documents/g4dev/googletest/1.7.0/googletest-release-1.7.0

red77.gif Define an environment variable for the directory where googletest source code is:

setenv GTEST_DIR $HOME/Documents/g4dev/googletest/1.7.0/googletest-release-1.7.0/

red77.gif Build with cmake:

mkdir mybuild
cd mybuild
cmake ${GTEST_DIR}  (to generate native build scripts)
make

red77.gif Install gtest in $GTESTPATH

cp -r ../include/gtest $GTESTPATH/include
cp -r lib*.a $GTESTPATH/lib


Back to APC2017 Lectures