-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GOOGLETEST_VERSION is not defined in CMakeLists.txt #2950
Comments
Hello I'm not sure the exact context If you want to check googletest version You can find how to use FindPkgConfig as below and once you find the package with it then you might refer its version with variable GTest_VERSION |
I'm sorry for the above comment (here in |
always, I use XXX_VERSION like:
But for gtest
The GTest_VERSION is empty @hyukmyeong |
I'm not sure whether you can get
Additionally, It's because as you see https://github.com/google/googletest/blob/master/googletest/cmake/gtest.pc.in |
I am facing the same issue. The variable |
Hello, @justapig9020 I think that you can build googletest only by turning off a build option (1.10.0 base)
And as zhaoyang-star said, |
Thanks, @hyukmyeong ! |
How about using find_package(GTest CONFIG REQUIRED)
message(STATUS "GTest_VERSION: ${GTest_VERSION}" I hope that this works $ ls -l /usr/local/lib/cmake/GTest/
GTestConfig.cmake GTestConfigVersion.cmake GTestTargets-noconfig.cmake GTestTargets.cmake |
The tutorial should be updated to avoid misleading users. |
Could you please review #3008 ? |
Done, thanks. |
I believe that the versioning information should be split out into a separate file which can then be I'm too lazy to actually make a PR, but something like this should work:
This should allow sub-projects to be built individually and still only requires changing the version in one common place. (N.B.: there are other places hard-coding the version, so these will still need to be updated manually, but my main point is that this approach won't add to proliferation of version numbers all over the place.) The drawback is that you can't split out the |
sudo apt-get install libgmock-dev |
I tried to fix this warning in #4539. |
GOOGLETEST_VERSION
is not defined in CMakeLists.txt. But it is used. So if I run commandmkdir mybuild && cd mybuild && cmake ..
the error happened:So is there no
GOOGLETEST_VERSION
been defined in repo? I inserted one lineset(GOOGLETEST_VERSION 1.9.0)
and the error disappeared.The text was updated successfully, but these errors were encountered: