From f692439d1ef5dc858d284cf36c79e23b97b5540e Mon Sep 17 00:00:00 2001 From: Jami Kettunen Date: Sun, 26 Feb 2023 16:20:48 +0200 Subject: tests: Fix building against modern GTest Fixes being unable to locate GMock (GTest) with gtest v1.12.1 as tested on Void Linux: CMake Warning at tests/CMakeLists.txt:1 (find_package): By not providing "FindGMock.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "GMock", but CMake did not find one. Could not find a package configuration file provided by "GMock" with any of the following names: GMockConfig.cmake gmock-config.cmake Add the installation prefix of "GMock" to CMAKE_PREFIX_PATH or set "GMock_DIR" to a directory containing one of the above files. If "GMock" provides a separate development package or SDK, be sure it has been installed. Also mark the library as REQUIRED since without it found attempting to build tests just fails at link-time with various errors such as: /usr/bin/ld: gtest-menuitems.cpp:(.text+0x14d): undefined reference to `testing::internal::GetBoolAssertionFailureMessage[abi:cxx11](testing::AssertionResult const&, char const*, char const*, char const*)' --- tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 74a258f..28c5727 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,4 +1,4 @@ -find_package(GMock) +find_package(GTest REQUIRED) # gtest-menuitems -- cgit v1.2.3