Comment 4 for bug 1986665

Revision history for this message
Eero Aaltonen (ejn) wrote (last edit ):

Tested with cmake from ppa and `libgmock-dev` installed.

Simple test project.

CMakeLists.txt
==============
cmake_minimum_required(VERSION 3.16)
project(CMake-gmock-test)

include(CTest)

find_package(GTest 1.10.0)

add_executable(test_gmock_tgt main.cpp)
target_link_libraries(test_gmock_tgt GTest::gtest GTest::gmock GTest::gmock_main)
add_test(NAME test_gmock_tgt COMMAND test_gmock_tgt)
==============

main.cpp
========
#include <gtest/gtest.h>
#include <gmock/gmock.h>
========

would compile (and not complain about missing targets) with commands:
```
cmake -S . -B build
cmake --build build/
ctest --test-dir build
```