-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
The CMake Build documentation is too detached from reality #4681
Comments
I vaguely remember the Google Test CMake quickstart not having the But as you mentioned, on Windows it's common to want both the Debug and Release configs, both of them linking to their respective shared C runtime libraries. To have Debug and Release libraries in the same installation root, the debug libs need a Until the documentation is updated this is how I build on Windows (64-bit, shared C runtimes, cmake -S . -B build_win -A x64 -Dgtest_force_shared_crt=ON -DCMAKE_DEBUG_POSTFIX=d
cmake --build build_win --config Debug -j
cmake --build build_win --config Release -j Both configs can then be installed into whichever install root is preferred, e.g. cmake --install build_win --prefix ..\googletest-1.15.0 --config Debug
cmake --install build_win --prefix ..\googletest-1.15.0 --config Release This gives the all the expected Google Test and Google Mock debug and release static libraries. Of course, from CMake, once find_package(GTest 1.10.0 REQUIRED) |
Thank you, I have omitted some of my actual builds, it's roughly indeed executing two |
I am indeed on a Windows environment, but I believe that whether it's Linux or Windows, we should prioritize using |
Yes, this is more meaningful on Linux (or similar) environment where often tagged Google Test versions are installed via the system package manager. In this case, it makes more sense to use When I have some time I think I will try to make a PR with some updates to the documentation to highlight these other common methods of Google Test integration with CMake. Otherwise, others might raise similar issues. |
Yes, you have exactly the same idea as me, I also define a |
I might open a new issue since I am considering adding a new page in the "Guides" section for building from source, as I showed in my previous comment, as well as updating the CMake quickstart page to also include Edit: May not necessarily create a new issue but I definitely think build from source instructions should go on a new page. |
Does the feature exist in the most recent commit?
No.
Why do we need this feature?
I don't think anyone built and imported the GTest testing framework the way the documentation did:
Describe the proposal.
I find this confusing, in fact I think what we should be writing is building from source and importing it using CMake:
Also, I think "gtest_force_shared_crt" should be defined during the configuration step (e.g.,
cmake .. -Dgtest_force_shared_crt=ON
), when generating the build system, rather than during the build or usage phase.Let me repeat, I think our documentation should be written to build from source, like:
If it's on Windows, it is also necessary to generate the Release version and install it.
Is the feature specific to an operating system, compiler, or build system version?
No.
The text was updated successfully, but these errors were encountered: