Closed Lekensteyn closed 6 years ago
Thanks for your proposal and especially measurements! They're pretty interesting.
I have nothing against CMake (I actually use it in another tool of mine); faster out-of-source-tree building is nice. But I don't think those benefits are worth making all package maintainers change their build recipes.
P.S. autotools somewhat support out-of-source-tree builds:
mkdir build
cd build
../configure
make
Both autotools and cmake can co-exist. I have added/maintained support for both build systems in various projects (some even have both), the only reason why autotools remains would be for cross-compiling and because some people are more familiar with it.
I really dislike having additional junk files in the source tree (Makefile.in, configure, config.status, etc.), autotools is inferior imo. Could you reconsider it, please? :)
I'm still not convinced that having two build systems is a good idea, but let CMake live in a feature branch. We might need it in future.
Supports out-of-tree builds without cluttering the source tree (as is the case with autotools) and enable faster builds with Ninja.
The only missing "feature" from autotools is an uninstall target. To mimic this after the install target:
xargs rm < install_manifest.txt
Note that header files are not listed in the sources list, CMake automatically discovers what headers are needed.
Main advantage is support for out-of-source-tree builds without cluttering the source tree. Nice side-effect is that a fresh build is 7x faster than autotools. The dependencies autoconf + automake + pkg-config + make can be replaced by cmake + ninja (optional, but recommended).
Build time (n=10, tmpfs):
autotools
autoreconf -i
mkdir build && cd build && ../configure
make
make -j10
time: 0.84sDESTDIR=$PWD/fs make install
make -j10 install
time: 0.15smake
make -j10
time: 0.065scmake + Ninja
mkdir build && cd build && cmake -GNinja ..
ninja
DESTDIR=$PWD/fs ninja install
ninja