cmake GTest "Could NOT find GTest (missing: GTEST_LIBRARY GTEST_MAIN_LIBRARY)"的解决办法
sudo apt-get install libgtest-dev
sudp apt-get install cmake
cd /usr/src/gtest
sudo cmake CMakeLists.txt
sudo make
sudo cp *.a /usr/lib
Could not find a package configuration file provided by “GFlags”
CMake Error at utils/src/CMakeLists.txt:23 (find_package):
By not providing "Findgflags.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "gflags", but
CMake did not find one.
Could not find a package configuration file provided by "gflags" with any
of the following names:
gflagsConfig.cmake
gflags-config.cmake
Add the installation prefix of "gflags" to CMAKE_PREFIX_PATH or set
"gflags_DIR" to a directory containing one of the above files. If "gflags"
provides a separate development package or SDK, be sure it has been
installed.
gflags源码仓库:https://github.com/gflags/gflags
然后解压并进入目录:
tar -xvzf gflags-2.2.2.tar.gz
cd gflags-2.2.2/
创建编译目录:
mkdir build
cd build/
开始编译:
cmake -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DINSTALL_HEADERS=ON -DINSTALL_SHARED_LIBS=ON -DINSTALL_STATIC_LIBS=ON ..
make
make install