cmake: link gtest_main to gmock lib
Starting with googletest 1.8.1, I meet the following error when building the tests. /usr/bin/ld: ../../../gmock/libgmock_main.a(gmock_main.cc.o): in function `main': /usr/src/googletest/googlemock/src/gmock_main.cc:52: undefined reference to `testing::InitGoogleMock(int*, char**)'
This commit is contained in:
parent
c8a760c1f9
commit
4dd4d8e339
1 changed files with 1 additions and 1 deletions
|
|
@ -77,7 +77,7 @@ target_link_libraries(gmock INTERFACE ${findgmock_gmock_lib} gtest)
|
|||
|
||||
add_library(gmock_main INTERFACE)
|
||||
target_include_directories(gmock_main INTERFACE ${GMOCK_INCLUDE_DIRS})
|
||||
target_link_libraries(gmock_main INTERFACE ${findgmock_gmock_main_lib} gmock)
|
||||
target_link_libraries(gmock_main INTERFACE ${findgmock_gmock_main_lib} gmock gtest_main)
|
||||
|
||||
set(GTEST_LIBRARIES gtest)
|
||||
set(GTEST_MAIN_LIBRARIES gtest_main)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue