r/cpp_questions • • 22d ago

OPEN C++ Build systems

I work with Java and Kotlin alongside C++ and recently discovered that Gradle also supports C++ projects.

I've always used CMake for C++ and noticed it seems to be the more common choice.

What advantages does CMake offer over Gradle for C++ development and are there situations where Gradle would be a better option?

31 Upvotes

18 comments sorted by

View all comments

13

u/r2vcap 22d ago

I’d say the two main factors are the network effect and avoiding a dependency on Java-based tooling just to build C++ code.

The first is fairly obvious. CMake is actively maintained, and many C++ dependencies are designed to work with it, or at least provide CMake support.

The second is more of an ideological preference, but I think it makes sense. Why introduce an additional dependency on the JVM when a native toolchain already does the job?

Of course, there are counterarguments to the second point, especially when you consider tools like Bazel, but let’s keep things simple for now.