[CMake] improve the CMake language?

Bill Hoffman bill.hoffman at kitware.com
Thu Nov 1 21:03:57 EDT 2007


Brandon Van Every wrote:

> My concern is that if the status quo is maintained, CMake script will
> always be ugly to program with.  This will put it at a disadvantage
> compared to build systems written in Python, Ruby, or Perl.  I'm not
> just talking about SCons and so forth.  I'm talking about a shop
> deciding, hey, screw this off-the-shelf stuff, we'll write our own
> custom build system in our favorite scripting language.  It happens in
> the game industry all the time.
> 
> Your thoughts?
> 
> 

CMake is a build system.  In an ideal world, the language would be 
purely declarative.  Basically, you would describe things you want to 
build, and CMake would build them.  In practice, this is too 
restrictive, and a small amount of programming makes things easier. I 
never wanted CMake to replace perl, ruby, python or any other language. 
I wanted CMake to not depend on another language being installed.  CMake 
only depends on a C++ compiler being around, so CMake can be built. 
Since CMake was developed for ITK (a c++ toolkit), I was adding no 
additional restrictions to the build process. The scripting stuff 
actually came out of a desire to automate the testing system without the 
use of tcl as was required in earlier version of Dart. I am sure the 
CMake language will be tweaked here and there, but if you have a big 
programming job that has nothing to do with building software, then 
CMake is the wrong choice.

So, I think that if something is hard to build because of the CMake 
language, then we should fix it.  People should use CMake because it is 
really easy to build complex things with, and not because it has a great 
language. The hard stuff should be done in C++ commands.

For example, this small line of CMake code:

add_library(foo SHARED foo.cxx)

does some very complicated stuff as it builds shared libraries on many 
platforms, and different IDE's.  And most of that is not done with the 
CMake language, it is done with the more powerful C++ language.  BTW, I 
hope this does not become a long discussion, but I am sure it will...


-Bill



More information about the CMake mailing list