未知的 CMake 命令“gtest_discover_tests”

发布于 2025-01-14 01:11:53 字数 471 浏览 3 评论 0原文

有人可以解释一下如何正确安装 Cmake 和 GoogleTest 以便命令

gtest_discover_tests

可用吗?我

cmake-3.23.0-rc3

从源代码

googletest-release-1.11.0

出现以下错误,我仍然无法编译该项目

https://github.com/D-os/libbinder

安装,但由于

CMake Error at tests/CMakeLists.txt:15 (gtest_discover_tests):
Unknown CMake command "gtest_discover_tests".

我使用 Slackware 14.2 x64

Can someone explain me please how to install properly Cmake and GoogleTest so the command

gtest_discover_tests

becomes available ?. I installed

cmake-3.23.0-rc3

and

googletest-release-1.11.0

from source but I still can't compile that project

https://github.com/D-os/libbinder

because of fallowing error

CMake Error at tests/CMakeLists.txt:15 (gtest_discover_tests):
Unknown CMake command "gtest_discover_tests".

I'm using Slackware 14.2 x64

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我一向站在原地 2025-01-21 01:11:53

该函数在 GoogleTest 脚本中定义文件(模块),因此您需要像这样包含它: include(GoogleTest)

然后您就可以使用该函数。

That function is defined in the GoogleTest script file (module) so you need to include it like this: include(GoogleTest)

Then you can use the function.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文