10

We have been using Gradle for our C++ project(s) for the last year now but as the complexity of the project grows and our use/creation of libraries increases I find myself dealing with situations where my knowledge of Gradle falls short.

The net is full of helpful resources for Gradle but it is extremely Java focused. Furthermore, I have not seen many C++ projects using Gradle. For these reasons, I am considering making the move to CMake since I am at point where I need to significantly edit our build scripts.

Is the move to CMake, a more battle testing and ubiquitous C/C++ build system, worth it? Or is sticking with Gradle, which recently came into the C++ game, worth the trouble?

Note: I know they are other C++ options out there but CMake seems like the one that would best replace our current solution.

Community
  • 1
  • 1
Jad
  • 413
  • 1
  • 5
  • 11

1 Answers1

12

My advice would be to use CMake. Many projects have already been successfully using it. CMake also has the CPack and CTest features, which are very helpful when working with projects. Additionally, many IDE projects can be generated using either Gradle or CMake.

Just to point out, CMake is not a build system but a build system generator.

Kuba hasn't forgotten Monica
  • 95,931
  • 16
  • 151
  • 313
Shiv
  • 1,912
  • 1
  • 15
  • 21
  • After doing some prototyping CMake looks like the go. Thanks for the answer. – Jad Apr 10 '16 at 01:20
  • 8
    If you are looking for an IDE with good CMake support, check out CLion: https://www.jetbrains.com/clion/ – phoenix Aug 17 '16 at 23:19
  • 1
    Emacs is the only editor. You can make it an IDE. https://tuhdo.github.io/c-ide.html enjoy. CLion is too expensive and slow. It is a bloatware. I have used it for one full year. Too slow for parsing C++ code. You write wrong code and it will give you a hint after 30 seconds or so depending on codebase. For sufficiently large codebase it has a hard time loading the project itself. Once I tried a 10G codebase and it died. Yes, I had given it 16G JVM heap. – Shiv Feb 18 '18 at 10:51
  • [ed is the standard text editor](http://wiki.c2.com/?EdIsTheStandardTextEditor) – Mark K Cowan Mar 20 '19 at 09:31
  • 5
    I find CMake is super confusing and one of the most difficult script languages to learn so I plan to go the other way around and migrate from CMake to Gradle. – t3chb0t May 20 '20 at 15:24