google/googletest

[Bug]: CMake FetchContent_* does not work with GTest as dependency name on Windows

Open

#4,384 创建于 2023年10月3日

在 GitHub 查看
 (7 评论) (0 反应) (0 负责人)C++ (10,772 fork)batch import
help wanted

仓库指标

Star
 (38,603 star)
PR 合并指标
 (平均合并 7天 8小时) (30 天内合并 1 个 PR)

描述

Describe the issue

CMake FetchContent_* does not work with GTest as dependency name. If the dependency name is changed to googletest or to foobar everything works as expected. This is very unfortunate because GTets is used in the find_package command of CMake and if this fails the FetchContent mechanism can be used as fallback. But not on windows as you can see here:

https://github.com/ObiWahn/googletest-CMake-FetchContent/pull/1

Steps to reproduce the problem

https://github.com/ObiWahn/googletest-CMake-FetchContent/pull/1/files

What version of GoogleTest are you using?

v.1.14.0

What operating system and version are you using?

windows

What compiler and version are you using?

msvc / clang

What build system are you using?

cmake 3.27.6

Additional context

No response

贡献者指南