【发布时间】:2019-01-19 23:27:19
【问题描述】:
我正在尝试在我以前在 Mac 上运行良好的项目上运行 cmake。
在我的 CMakeLists.txt 中有:
find_package(gtest REQUIRED CONFIG)
当我运行 cmake 时,我看到:
CMake Error at CMakeLists.txt:123 (find_package):
Could not find a package configuration file provided by "gtest" with any of
the following names:
gtestConfig.cmake
gtest-config.cmake
Add the installation prefix of "gtest" to CMAKE_PREFIX_PATH or set
"gtest_DIR" to a directory containing one of the above files. If "gtest"
provides a separate development package or SDK, be sure it has been
installed.
-- Configuring incomplete, errors occurred!
我已经在/usr/include/gtest 中构建了源代码并将它们安装到/usr/lib/。
【问题讨论】:
-
定位GTest的脚本名为FindGTest.cmake,所以你需要搜索包“GTest”,而不是“gtest”。
-
谢谢,成功了!
-
@Tsyvarev 也许输入一个答案,所以我可以接受?
标签: ubuntu cmake googletest