Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 6025

CMake cannot find GoogleTest required library in Ubuntu

$
0
0

Similar issue here.

This is my CMakeLists.txt:

cmake_minimum_required(VERSION 2.6)# Locate GTestfind_package(GTest REQUIRED)include_directories(${GTEST_INCLUDE_DIRS})# Add test cpp fileadd_executable(foo foo.cpp)# Link test executable against gtest & gtest_maintarget_link_libraries(foo ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES} pthread)

And my 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();}

Now, all works fine when using the g++ compiler. However, when attempting to use QNX's compiler, ntox86-c++, I run into this problem:

CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:97 (MESSAGE): Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)

I am on Ubuntu using the ntox86-c++ compiler, googletest, and cmake-gui.

What gives?


Viewing all articles
Browse latest Browse all 6025

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>