Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

87.18. gtest-1.18.0

GoogleTest and GoogleMock — the C++ unit-test and mocking frameworks

1.18.0-1 · BSD-3-Clause · 1.3 SBU · 2.0 MiB, 57 files · 41_system, 355 of 1047 · ports/core/devlibs/gtest

Homepage: https://github.com/google/googletest

Depends on: cmake, ninja.

Required by (2): android-tools, gnucash.

Sources: gtest-1.18.0.tar.gz (873.8 KiB). Every step kpkg takes applies to this port.

Install: script/chroot/exec.sh bash -c 'source script/phases/41_system/phase.env && kpkg install gtest'

build.sh:

cmake -B build -G Ninja -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
	-DCMAKE_BUILD_TYPE=Release \
	-DCMAKE_INSTALL_PREFIX=/usr \
	-DCMAKE_INSTALL_LIBDIR=lib \
	-DBUILD_SHARED_LIBS=ON \
	-DBUILD_GMOCK=ON \
	-DINSTALL_GTEST=ON \
	-Dgtest_build_tests=OFF \
	-Dgtest_build_samples=OFF \
	-Dgmock_build_tests=OFF
cmake --build build
DESTDIR=$PKG cmake --install build

Libraries: libgmock.so, libgmock_main.so, libgtest.so, libgtest_main.so.

Directories: /usr/include/gmock, /usr/include/gtest, /usr/lib/cmake/GTest, /usr/share/licenses/gtest.