Yet another CMake Blog

Since everyone else is blogging on build systems today, I thought I'd join in. Overall CMake seems to be working out ok, but like anything else, it is not without its problems. One problem I had with it was fixed in the new release this weekend though - you no longer need to write:

IF something
  do stuff
ELSE something
  do other stuff
ENDIF something

I don't understand why it was written like that in the first place, but hey it's fixed so lets move on.

The other issue I have is more serious - the command line usage is frankly awful. Accordingly I'd like to know what people would like to see in a 'configure' wrapper script that lets you invoke cmake without -DSOME_VERY_OBSCURE_COMMAND in order to something as simple as tell it where to install. The things that I think need to be in there so far are:

  • --prefix
  • --debug
  • --qt-dir
  • --kde-dir
  • An option for passing raw cmake options for stuff not covered by the wrapper.

Anything else that should be provided?


Forcing 32-bit versus 64-bit would be nice for multi-arch systems. Also, there are other flags that might be nice like the old configure script had.....

Maintainer of KDE for the PhoeNUX OS project.
Developer of the Phinos installer.

By greeneg at Sun, 08/06/2006 - 23:47

... there's the idea to make configurable "shortcuts" for the command line options.
So we would have a file something like this


and then instead of
cmake ... -DCMAKE_INSTALL_PREFIX=/opt/kde4 -DLIBINSTALL_DIR=/foo/lib

you could write

cmake ... --prefix=/opt/kde4 --libdir=/foo/lib

This is intended to be done in cmake, but hasn't happened yet.
Maybe I'll have a look at it.
OTOH there's also ccmake to set this stuff, and q Qt4 version of it is still missing (anybody wants to try ?)

I don't think writing a wrapper script named "configure" is a good idea, since it will make people expect that it behaves exactly like configure.


By Alexander Neundorf at Mon, 08/07/2006 - 07:51


I started just this sort of script (i'll send it to you in a separate message). I even asked about it on kde-buildsystem. Where it was shot down as a bad idea.

The consensus was to have configure script that outputs the cmake command to call. So if you go ./configure --prefix /usr, it will say "KDE does not use autoconf anymore, next time use cmake -D...

By awinterz at Mon, 08/07/2006 - 18:32

Hmm, it was shot down? I hope it was for a different reason as alex on this blog stated; that he expects a feature to be added to cmake in a future release.
A good working configure script which we have now and that does what 95% of our users expect is always better then a not-yet-created solution.

Anyway; I think this email states the consensus among core devs:

So, please continue working on what you feel is a good solution.
All the power to you! :-)

By Thomas Zander at Mon, 08/07/2006 - 19:48

Ashley forwarded me the emails from the build system people, and yeah, they weren't keen. I'm going to write it anyway though as I definitely not going to type -DSOMETHING_RIDICULOUS more often the absolutely necessary. I'll make the script available to everyone once I'm done irrespective of if it is suitable for going in svn.

By Richard Moore at Tue, 08/08/2006 - 12:26