Skip to content

Fix googletest CMake build#740

Merged
mhucka merged 2 commits into
masterfrom
mh-fix-tests-makefile
Jun 7, 2025
Merged

Fix googletest CMake build#740
mhucka merged 2 commits into
masterfrom
mh-fix-tests-makefile

Conversation

@mhucka
Copy link
Copy Markdown
Collaborator

@mhucka mhucka commented May 29, 2025

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.

In addition, the original makefile had a subdirectory named "make". Have 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 PR also renames the directory to build.

mhucka added 2 commits May 29, 2025 23:29
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`.
@mhucka mhucka self-assigned this May 30, 2025
@mhucka mhucka changed the title Fix googletest cmake build Fix googletest CMake build May 30, 2025
@mhucka mhucka requested review from dstrain115 and pavoljuhas May 30, 2025 18:12
@mhucka mhucka merged commit 442a0d5 into master Jun 7, 2025
14 of 19 checks passed
@mhucka mhucka deleted the mh-fix-tests-makefile branch June 7, 2025 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants