-
Notifications
You must be signed in to change notification settings - Fork 10
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
build(cmake): Use FindGTest if possible #95
Conversation
@lukhnos this is the follow-up from #94 There are actually some benefits from building googletest with tarball, listed here: Please let me know which approach you'd prefer. |
I didn't notice any difference by using the system package (https://archlinux.org/packages/extra/x86_64/gtest/) vs the tarball, they are both v1.14.0 anyway. Due to the CMake issue I noted in README, I didn't get a chance to test this on Ubuntu. Perhaps we'll see in future Ubuntu releases. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Just one small nit re documentation.
Re:
There are actually some benefits from building googletest with tarball, listed here:
https://github.com/google/googletest/tree/main/googletest#incorporating-into-an-existing-cmake-project
I actually like your current approach, which uses a tagged version. Also just for my own edification, what are the benefits of using a tarball? I can't seem to find that in the gtest page above.
@lukhnos apologies for the delayed response. I've been a bit busy recently. The main benefits of fetching CMake into the build directory instead of using the system installed version is that we can ensure googletest suite is built with the same tool chain as the project.
Another benefit is that we may use a slightly newer version of googletest (v.1.14), vs the system package libgtest-dev_1.11.0-3_amd64.deb. |
Utilize FindGTest to locate googletest if installed on the system. If googletest is not installed, fetch the specified version in src/CMakeLists.txt Also remove redundant FetchContent blocks in subdirectories.
^ rebased onto upstream/master. |
You mean gtest I assume. Now I see your point. At any rate, this is a relatively small and straightforward project, and as a result I feel that we should be as toolchain agnostic as possible (gcc vs clang, gtest shipped with dist vs fetched-into-build, and so on). So I think this PR is good to go. |
yeah, I meant |
Utilize FindGTest to locate googletest if installed on the system. If googletest is not installed, fetch the specified version in src/CMakeLists.txt
Also remove redundant FetchContent blocks in subdirectories.