google / googletest

GoogleTest - Google Testing and Mocking Framework
https://google.github.io/googletest/
BSD 3-Clause "New" or "Revised" License
34.53k stars 10.09k forks source link

[FR]: (CMake) Allow using external abseil-cpp and re2 #4425

Closed tamaskenez closed 10 months ago

tamaskenez commented 10 months ago

Does the feature exist in the most recent commit?

No.

Why do we need this feature?

When building with CMake, it is not possible to build google test with external abseil-cpp and re2 libraries. Specifying the GTEST_HAS_ABSL=ON expects the abseil and re2 targets to be built by the same project. However, in that case the googletest targets can't be installed since the CMake build system warns that they refer to other targets which aren't installed.

Describe the proposal.

The CMake build script can test if the absl and re2 targets exist. If they don't, invoking find_package for absl and re2 would import the external targets. The Config.cmake.in also needs to be modified to look for absl and re2.

Is the feature specific to an operating system, compiler, or build system version?

It's specific to the CMake build system.