google / googletest

GoogleTest - Google Testing and Mocking Framework

Home Page:https://google.github.io/googletest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cmake find_package can not find gmock on manual compile

Meigumikato opened this issue · comments

on my mac, when i use brew install googletest cmake can correctly find gtest and gmock , but when i manu
al compile googletest and install it,my cmake only can find gtest not correctly find gmock

my cmakelists.txt
set(GTEST_ROOT ${CMAKE_SOURCE_DIR}/third_party/googletest/output)
find_package(GTest REQUIRED)
target_link_libraries(xxx PRIVATE
GTest::gmock_main
GTest::gtest_main)

my install lib dir

cmake
libgmock.1.11.0.dylib
libgmock.a
libgmock.1.11.0.dylib
libgmock_main.1.11.0.dylib
libgmock_main.a
libgmock_main.1.11.0.dylib
libgtest.1.11.0.dylib
libgtest.a
libgtest.1.11.0.dylib
libgtest_main.1.11.0.dylib
libgtest_main.a
libgtest_main.1.11.0.dylib
pkgconfig

use find_package(GTest CONFIG REQUIRED) instead

ok, thanks