这是我的 CMakeLists.txt:
cmake_minimum_required(VERSION 2.6)
# Locate GTest
find_package(GTest REQUIRED)
include_directories(/usr/include/gtest)
# Link runTests with what we want to test and the GTest and pthread library
add_executable(runTests gtest.cpp)
target_link_libraries(runTests /usr/lib/gtest pthread)
运行 cmake 时出现以下错误:
michael@michaelFriko:~/workspace/gtest/src$ cmake CMakeLists.txt
CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:97 (message):
Could NOT find GTest (missing: GTEST_LIBRARY GTEST_MAIN_LIBRARY)
Call Stack (most recent call first):
/usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:291 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-2.8/Modules/FindGTest.cmake:150 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:8 (find_package)
如何解决这个问题?