How to use GTest with CMake ? Linkage problem when following Google's guide
问题 I started to use boost test for my project, but I need to mock static methods, so I try to switch to GTest and GMock. I followed the really clear guide from google, and the CMakeLists seems to be doing its job : CMakeLists.txt cmake_minimum_required(VERSION 3.15) project(POC_V4) set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED TRUE) # Specifying we are using pthread for UNIX systems. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS} -pthread -Wall") find_package(OpenCV