Fix googletest CMake build#740
Merged
Merged
Conversation
Possibly due to changes in more recent versions of Googletest, or possibly due to changes in more recent versions of CMake, the previous way that CMake was invoked to build the googletest library failed with errors about `GOOGLETEST_VERSION` being undefined. This was happening because `cmake` was being run from `tests/googletest/googletest/make` instead of `tests/googletest/googletest`. Changing the directory where CMake is invoked and adding the `-B` flag fixes that problem.
Having a subdirectory named "make" when the program `make` is being used is confusing at the very least, and may lead to errors depending on how the user's `$PATH` is set up. This commit renames the directory to `build`.
pavoljuhas
approved these changes
Jun 6, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Possibly due to changes in more recent versions of Googletest, or possibly due to changes in more recent versions of CMake, the previous way that CMake was invoked to build the googletest library failed with errors about
GOOGLETEST_VERSIONbeing undefined. This was happening becausecmakewas being run fromtests/googletest/googletest/makeinstead oftests/googletest/googletest. Changing the directory where CMake is invoked and adding the-Bflag fixes that problem.In addition, the original makefile had a subdirectory named "make". Have a subdirectory named "make" when the program
makeis being used is confusing at the very least, and may lead to errors depending on how the user's$PATHis set up. This PR also renames the directory tobuild.