[ccan] CMake build system
Stewart Smith
stewart at flamingspork.com
Fri Mar 14 10:11:14 EST 2014
Nicu Tofan <nicu.tofan at gmail.com> writes:
> I would like to know your thoughts on adding a CMake build system as
> the
So, I've had the misfortune of dealing with large and complex CMake
projects (MySQL and variants such as MySQL Cluster, Percona Server) so I
can add some amount of experience here.
Pretty much the only advantage of CMake is that it's a bit less foreign
for Windows users.
Nothing has ever made me love M4 as much as CMake. You see, m4 is a
defined thing. You can go and read up on what M4 is, what the syntax is
and know that it's an actual language.
With CMake, all you have is one crappy (expensive) book that solves none
of the problems you run into on a larger project, and the online
documentation is just as lacking.
Also, when you do hit an issue you've got pretty much nothing to fall
back on apart from CMake source code, which isn't exactly where you want
to be. The "language" for CMake is not well defined anywhere that I've
found, so unlike M4, it's not actually a defined thing.
Sure, trudging through broken generated /bin/sh scripts to find out what
you put wrong in your configure.ac/m4 foo is annoying, but /bin/sh is
also a defined thing - and now that you have m4 being a defined thing
and sh being a defined thing, you can at least through some intelligent
trial and error get somewhere. Not so with CMake, you get one cryptic
error message out of CMake and that's it - you get to keep both pieces.
It goes the same for the Makefile part, Makefiles are a defined thing
that you can go and fix, not so with CMake, there's this giant binary in
the way of your CMakeLists.txt and your makefiles (which may actually be
Visual Studio project files for the Windows side of things).
Then there comes things like ensuring 'make dist' and 'make distclean'
work correctly, which can be slightly challenging for CMake (for
example, MySQL has never gotten 'make distclean' to actually work with
CMake).
Sure, you can write horrible autoconf and automake things, but there's a
decent amount of documentation out there as to how to write really good
autoconf and automake - and it's honestly pretty easy.
and it's because of my many years having to interact with CMake that I
absolutely love m4 (and I only feel slightly dirty about it).
That being said - it's great to see patches along with "hey try this"!
It's Rusty's call way more than mine, and I can be considered the crazy
damaged person crying about build systems in the corner :)
--
Stewart Smith
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/ccan/attachments/20140314/2369836e/attachment.sig>
More information about the ccan
mailing list