Skip to content

Conversation

ryouze
Copy link

@ryouze ryouze commented Nov 10, 2024

Describe the changes

I've added a section explaining how to download the project using CMake's built-in FetchContent instead of CPM.

By the way, your C/C++ tutorial is excellent - concise and straight to the point.


Style
Linting
Testing

This PR doesn't modify any C++ code.

@bshoshany
Copy link
Owner

bshoshany commented Nov 11, 2024

Hi @ryouze and thanks for this PR!

To my understanding, CPM is essentially a wrapper around FetchContent which offers additional functionality such as dependency management and caching, which is why the documentation recommends using CPM instead of using FetchContent directly. In both cases it works out of the box, since CMake will download CPM itself if necessary. However, I admit that I myself don't use CMake much, since my projects tend to be small and self-contained. Is there any benefit to using FetchContent directly over CPM?

PS: I'm glad you liked my C/C++ lecture notes! :)

@ryouze
Copy link
Author

ryouze commented Nov 11, 2024

However, I admit that I myself don't use CMake much, since my projects tend to be small and self-contained.

CMake makes cross-platform app development really easy, even for small projects.

In my project, I use GitHub Actions to build and test binaries on macOS, GNU/Linux, and Windows. The steps are identical across all platforms.

Is there any benefit to using FetchContent directly over CPM?

It's a matter of personal preference. I prefer having full control over the build process and doing everything myself without relying on third-party libraries.

For instance, I was initially very opposed to using python-poetry until I found out that it's largely compatible with pip, allowing users to choose whichever tool they prefer.

Likewise, this PR simply gives users more options.

@bshoshany
Copy link
Owner

Sure, I will include it in the upcoming v5.0.0 release so people know they can use this method if they prefer. I will probably make some changes and/or add some additional information. Thanks again! Closing this PR for now, since this will be included in the next release.

@bshoshany bshoshany closed this Nov 11, 2024
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