[cairo] CMake

Luca Barbato lu_zero at gentoo.org
Fri May 2 00:55:14 PDT 2008

Jason G wrote:
> Well, the benefit is twofold:
> First, it's universal, in the sense that it generates Makefiles as
> well as codeblocks projects, visual studio projects, kdevelop
> projects, xcode projects, etc. etc.  While we can sit here and argue
> all day about whether emacs/vim is a better programming environment
> than visual studio, the fact is that cmake supports all of these
> environments and makes your project more accessible to people who are
> tied to their environment.

I cannot see why those IDE cannot do as eclipse, vim, emacs, pida, etc 
do: support directly the widespread automake, well at least kdevelop does.

I don't see the point in having multiple generators (what are you 
supposed to do then, every time you add/remove/modify stuff from the 
specific project script you have to have cmake parse it and come up with 
another common-cmake list ? Even if possible, I don't know, I see no 
gain since you may just import the filesytem add a simple highlight for 
automake files (or a generator out of the internal representation) and 
link the build and run IDE events to autoreconf and make... Not exactly 
rocket science...

> Using autotools instead of cmake is like having cairo but with only one backend.

I feel more like having cairo rewritten in C++ linked to apache for 
unknown reasons, having a build time next to the whole X and having it 
to produce intermediate 17,5bit per 9 channel pixels or something as 
convoluted as well.

> Second, it gives the user more customization with respect to library
> locations on the filesystem.  Instead of trying to look for a library
> in a few locations or using an environment variable, with cmake you
> can let the user specify directories for libraries.

Apparently you don't know autoconf nor why having nonstandard defaults 
is bad.

> Many users will probably just put /usr/include and /usr/lib or /usr/local/...
> , but if you want to test different versions of a dependency or you use windows
> or something like that, you can specify the directories of your
> library files for each project.

--prefix and the --with-foo=path and DESTDIR works quite fine. Keep in 
mind that if you use pkg-config you can just point the single alternate 
dir for the pc files and you get the result you expect with ease. Again 
no rocket science involved and nothing new.

> This is what I tried to do with my
> cmake script.  I've found this useful for comparing how the SVN
> version of a library compares to the latest ubuntu version.

Nothing you cannot do with an autoconf generated configure.

> Hopefully this will explain the benefits I've found in using cmake.

Please take your time to check which are the current limitations of 
cmake and autotools, I'm afraid you hadn't used autotools enough time or 
you got the ugly and wrong documentation to learn (that's the first big 
shortcoming about automake, stale documentation or ugly documentation 
appear when you look for it).



Luca Barbato
Gentoo Council Member
Gentoo/linux Gentoo/PPC

More information about the cairo mailing list