Skip to content

CMakeLists.txt: use external gtest, fallback to fetching the source - #288

Merged
greg7mdp merged 1 commit into
greg7mdp:masterfrom
barracuda156:gtest
Oct 15, 2025
Merged

CMakeLists.txt: use external gtest, fallback to fetching the source#288
greg7mdp merged 1 commit into
greg7mdp:masterfrom
barracuda156:gtest

Conversation

@barracuda156

@barracuda156 barracuda156 commented Oct 15, 2025

Copy link
Copy Markdown
Contributor

Resolves #287

@greg7mdp greg7mdp left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix @barracuda156

@greg7mdp
greg7mdp merged commit 8bd66dc into greg7mdp:master Oct 15, 2025
10 checks passed
@barracuda156
barracuda156 deleted the gtest branch October 15, 2025 22:40
@greg7mdp

greg7mdp commented Oct 15, 2025

Copy link
Copy Markdown
Owner

Hum, This fails to build on linux. I get build errors:

In file included from /home/greg/github/greg/gtl/tests/phmap/flat_hash_map_test.cpp:41:
/home/greg/github/greg/gtl/tests/phmap/unordered_map_constructor_test.hpp:28:10: fatal error: 'gmock/gmock.h' file not found
   28 | #include "gmock/gmock.h"
      |          ^~~~~~~~~~~~~~~
1 error generated.
[21/41] Building CXX object CMakeFiles/test_vector.dir/tests/misc/vector_test.cpp.o
ninja: build stopped: subcommand failed.

Looks like GTest_FOUND is true, but the target GTest::gmock_main is not present. On my system I have libgtest-dev installed.

@barracuda156

barracuda156 commented Oct 16, 2025

Copy link
Copy Markdown
Contributor Author

@greg7mdp I cannot test on Linux, but maybe then add an explicit option instead? So that it can be turned off or on.

What does CMakeCache file has in the build directory? It is supposed to set paths to libs and headers.

@greg7mdp

Copy link
Copy Markdown
Owner

but maybe then add an explicit option instead? So that it can be turned off or on.

@barracuda156 8bd66dc

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.

Recent updates to gtest break the build of parallel-hashmap

2 participants