googletest icon indicating copy to clipboard operation
googletest copied to clipboard

[Bug]: Undeclared GOOGLETEST_VERSION variable causes CMake build failure

Open jeffmachyo opened this issue 1 year ago • 2 comments

Describe the issue

When following the instructions as per this readme: https://github.com/google/googletest/blob/main/googletest/README.md I noticed that there is a variable known as GOOGLETEST_VERSION used in line 50 of the CMakeLists.txt but this variable is not declared anywhere in the file causing the build to fail. Once the user declares this variable, the build succeeds. Is it possible to update your documentation to advise users to manually specify the GOOGLETEST_VERSION variable?

Steps to reproduce the problem

gtest_cmake_error

Variable GOOGLETEST_VERSION used in Line 50 but is not declared causing the build to fail.

What version of GoogleTest are you using?

Version 1.13.0

What operating system and version are you using?

Using Ubuntu 22.04.2 LTS

What compiler and version are you using?

gcc 11.3.0

What build system are you using?

cmake version 3.22.1

Additional context

No response

jeffmachyo avatar Jul 07 '23 03:07 jeffmachyo

Same here, both googletests and googlemock needs to be built with cmake .. -DGOOGLETEST_VERSION=1.13.0

jvillasante avatar Jul 08 '23 12:07 jvillasante

@dinord @derekmauro I've provided a potential fix for this issue in the pull request above. Please review and tell me whether you're okay with the way I fixed it.

tobbi avatar May 14 '24 07:05 tobbi