Colleagues !
I try to write simple application with google test and cmake. I do as written in documentation. My CMakeLists.txt is
cmake_minimum_required (VERSION 2.6)
project (foo_d-google-test)
add_executable (foo_d-google-test main.cpp)
enable_testing()
find_package(GTest REQUIRED)
if (NOT GTest_FOUND)
message(FATAL_ERROR "Cannot find Google Test Framework!")
endif()
and main.cpp is
#include <math.h>
#include <gtest/gtest.h>
TEST (SquareRootTest, PositiveNos) {
EXPECT_EQ (18.0, sqrt (324.0));
EXPECT_EQ (25.4, sqrt (645.16));
EXPECT_EQ (50.3321, sqrt (2533.310224));
}
TEST (SquareRootTest, ZeroAndNegativeNos) {
ASSERT_EQ (0.0, sqrt (0.0));
ASSERT_EQ (-1, sqrt (-22.0));
}
int main(int argc, char* argv[])
{
testing::InitGoogleTest(&argc, argv);
int ret = RUN_ALL_TESTS();
return ret;
}
And I receive an error
CMake Error at /usr/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:138 (message): Could NOT find GTest (missing: GTEST_LIBRARY GTEST_MAIN_LIBRARY)
My platform is Debian Linux 9, and library googletest was installed. Any idea ?
Thanks a lot.