O CMake não consegue encontrar a biblioteca necessária do GoogleTest no Ubuntu
Problema semelhanteaqui.
Este é o meu CMakeLists.txt:
cmake_minimum_required(VERSION 2.6)
# Locate GTest
find_package(GTest REQUIRED)
include_directories(${GTEST_INCLUDE_DIRS})
# Add test cpp file
add_executable(foo foo.cpp)
# Link test executable against gtest & gtest_main
target_link_libraries(foo ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES} pthread)
E meu foo.cpp:
#include <gtest/gtest.h>
TEST(sample_test_case, sample_test)
{
EXPECT_EQ(1, 1);
}
int main(int argc, char **argv)
{
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
Agora, tudo funciona bem ao usar o compilador g ++. No entanto, ao tentar usar o compilador do QNX, ntox86-c ++, deparo com este problema:
Erro CMake em /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:97 (MESSAGE): NÃO foi possível encontrar o GTest (ausente: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)
Estou no Ubuntu usando o compilador ntox86-c ++, googletest e cmake-gui.
O que da?