GoogleTest quick installation at the APC School


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

REQUIREMENTS: googletest requires

Make sure that they are available on your laptop, or install them if they are not installed yet.

Create a directory where googletest source code will be placed, e.g.:
mkdir googletest
and move into it:
cd googletest

Download a googletest stable release (version 1.17.0 is used for the APC 2025 School).

Unzip/untar what you downloaded:
tar -xvzf googletest-1.17.0.tar.gz
unzip googletest-1.17.0.zip

Go into the googletest release directory:
cd googletest/googletest-1.17.0

Build googletest:
mkdir build
cd build
cmake .. (to generate native build scripts)
NOTE: you may need to specify the architecture of your laptop, e.g. for a Mac cmake .. -DCMAKE_OSX_ARCHITECTURES=arm64 or cmake .. -DCMAKE_OSX_ARCHITECTURES=x86_64
make

Install googletest (by default in /usr/local):
(make sure you have the necessary privileges, e.g. to install it in /usr/local/)
sudo make install

Make sure that the location where you installed googletest (e.g. /usr/local/) is in your PATH.

Back to APC2025 Lectures


M.G. Pia, 2025