0

I'm installing google test to use with Xcode, but I'm running into a small problem. When installing the headers and libs on my system it is recommended to use the following commands

$ sudo cp -a include/gtest /usr/include
$ sudo cp -a lib/.libs/* /usr/lib/

However, I am getting this error

cp: include/gtest: No such file or directory

Does anyone know how to properly install the files after I've built them?

1 Answers1

0

The instructions you are referring to are wrong and outdated. The hidden .libs directory comes from when gtest was built with autotools. I suggest the following:

Get the latest version, 1.8, from the current gtest/gmock repository at https://github.com/google/googletest.

Read https://github.com/google/googletest/blob/master/googletest/README.md for how to build with cmake.

Specify the install prefix with CMAKE_INSTALL_PREFIX on the command-line, or use cmake-gui for a more friendly experience. Do not install anything below /usr/ (it is a system path); I suggest installing below /usr/local/ or, even better, to install locally for each project that needs gtest, for example in the same build directory of the project.

marco.m
  • 4,573
  • 2
  • 26
  • 41