vgyorgy / craftmanship_training

0 stars 3 forks source link

CMake can't find GTest package #4

Closed kurdibogdan closed 2 years ago

kurdibogdan commented 2 years ago

Error log:

cmake -B ./craftmanship_training-main/ -- The C compiler identification is GNU 6.3.0 -- The CXX compiler identification is GNU 6.3.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done CMake Error at /usr/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:138 (message): Could NOT find GTest (missing: GTEST_LIBRARY GTEST_MAIN_LIBRARY) Call Stack (most recent call first): /usr/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE) /usr/share/cmake-3.7/Modules/FindGTest.cmake:194 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) CMakeLists.txt:6 (find_package)

-- Configuring incomplete, errors occurred! See also "/home/deveushu/workspace/CMakeFiles/CMakeOutput.log".

kurdibogdan commented 2 years ago

Maybe this helps: https://stackoverflow.com/questions/24295876/cmake-cannot-find-googletest-required-library-in-ubuntu This worked for me:

sudo apt install libgtest-dev build-essential cmake cd /usr/src/googletest sudo cmake . sudo cmake --build . --target install

kurdibogdan commented 2 years ago

Use CMake 3.21.0.