Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does cmake use convention over configuration?

Maven is said to employ a form of Convention over Configuration.

I don't want to draw any wrong comparisons but as far as I understand cmake can fill a similar roll for a C++ project as maven can for a Java project.

So, does cmake have some Conventions over Configuration, or is each project configured uniquely? (Wrt. file layout, test layout, build output, etc.)

like image 472
Martin Ba Avatar asked Oct 09 '22 17:10

Martin Ba


1 Answers

After experiencing the elegance of Maven 3, I also looked for a convention over configuration C maven style system. ...

I also checked out CMAKE, after creating a skeleton a few things stood out.

  1. CMAKE is sometimes declarative, sometimes procedural, and your always going to end up with an ugly mix. AKA, it's ANT for C without brackets.

  2. CMAKE itself IS portable, alas your project will need platform specifics handled and you better know them in advance. CMAKE modules exist to supposedly help with this, unfortunately their re-usability appears more like the promise of Ansible roles... Theoretically possible, but in practice they end up as decent way for you to organize all that complexity required.

In other words, CMAKE is in no shape or form like Maven. It's more like a lower level ANT, that allows you to use the "Cross-platform" DSL to generate platform specific makefiles.

like image 140
J. M. Becker Avatar answered Oct 13 '22 11:10

J. M. Becker