cmake find_package can not find gmock on manual compile
Meigumikato opened this issue · comments
Mirac1e commented
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)
Mirac1e commented
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
Huy Q. Bui commented
use find_package(GTest CONFIG REQUIRED) instead
Mirac1e commented
ok, thanks