cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Curl and CMake

From: Andy Cedilnik <andy.cedilnik_at_kitware.com>
Date: Thu, 14 Sep 2006 14:39:49 -0400

Hello Daniel,

Daniel Stenberg wrote:
> *I* don't maintain all those files alone. The people who care about
> them do. It means that if there's no one around who care for a
> particular port, it will lag behind. But the point is that I
> personally often don't have to care about much more than the
> configure.ac file.
Makes sense. As I said, I would take over maintaining CMake files at
least until somebody else does not find them interesting. That said, we
use Curl in CMake, so that will make sure that at least default
configurations will always compile.

> I don't know CMake, and chances are that most of the other curl build
> hackers don't either, so instead of a system with many files that work
> (and are maintained in a fairly distributed way), we'll get a system
> with less files that no one of us master. Your own site even claims
> that the CMake docs are in a bad shape which would be a hinder for us
> to learn and become good at it.
Not sure about that, but we do have a pretty good book about CMake and
the KDE community is contributing documentation on the Wiki.

> Also, the autobuild system would also be a problematic area when
> switching CMake since less servers/users have that installed.
CMake is available for pretty much every os, and it is available in
Cygwin, Debian, Gentoo, Fink, ... It is also trivial to build, but you
do have to have it on the system if you want to build the project. That
said, you do have to have compiler and other stuff. In case of autoconf,
you do have to have shell and awk and so on.

> I'm also scared about what I read on your mailing list:
> "CMake doesn't have any cross-compilation support at present"
> The lack of such completely rules it out for curl. Even though I'll be
> fair and say that I don't know exactly how far off from this point you
> are or how hard it would be to hack in.
Cross compiling is one of the issues that people are throwing out all
the time, but it actually turns out that Autoconf does not have good
support for cross compiling either. Let me explain that. There are two
problems with cross compiling:

1. Notion of target versus host compiler/linker etc.
2. Performing try compile/try run or any other system inspection.

CMake does not support #1, but it can do parts of #2 (like try compile
but not try run for obvious reason). That said, autoconf is pretty much
in the same boat here. The only difference is that in autoconf you can
hack #1 since you have shell. That said, if you are brave enough, you
can do the same thing with CMake, but it will not be cross platform.

> What files does this single one depend on or use? CurlTests.c only?
Pretty much. There may be some CMake variables it requires, but we can
probably fix that pretty quickly.

> Is this really feature-complete with the existing configure in curl?
> (OpenSSL, GnuTLS, c-ares, libidn, krb4, zlib, ca bundle, gssapi,
> protocol disable/enable and more). I can see it having support for
> some of them, but I don't see how you for example can tell the script
> where to find specific libs etc.
It is not feature complete. It is complete enough that it worked for us.
I suspect that if I would try to cmakify whole Curl and run all the
tests, I would need to do some more work. That said, I suspect that
several contributed build systems such as Borland, Visual Studio, etc
are not complete either.

> http://cool.haxx.se/cvs.cgi/curl/configure.ac.diff?r2=1.204&r1=1.90&diff_format=u
>
> Quite a few changes done in configure.ac alone since then...
Yeah, and this is the reason for this effort. If CMake files are in
Curl, I can make sure they are up-to-date and this way CMake can use the
latest version of Curl all the time.

> So those two files are the only ones required? Can I just put them in
> a subdir and CMake would be happy?
We require a CMakeLists.txt file in the toplevel source directory. Other
files can be stored in any directory you want.

> And one thing that I tried to get answered on your web pages but I
> couldn't find an easy answer to:
> When you build curl using CMake, do you actually need CMake installed
> to do it? I mean the end user who downloads the curl tarball.
As I sad before, if you want to build a project that uses CMake, you
must have CMake installed on the system.

-- 
Andy Cedilnik
Kitware Inc.
Received on 2006-09-14