[CMake] improve the CMake language?

Sanchez, Juan juan.sanchez at amd.com
Thu Nov 1 21:34:27 EDT 2007


Tcl is a nice language for implementing declarative commands.  It can be easily built on about every platform out there, and the language rules are well known.  It is small, and very easy to compile a standalone Tcl based interpreter with the CMake commands built in.  The user would not need to have any language installed, you could package the source with CMake or make it part of the cmake binary you distribute.  It is freely distributable and has a BSD license.

add_library(foo SHARED foo.cxx)

could become
add_library {foo SHARED foo.cxx}

or even
add_library -name foo -type SHARED foo.cxx

Please see:
http://en.wikipedia.org/wiki/Tcl

for a description of this language.  It would be very easy to implement a macro as a procedure.


I would be happy to participate in any effort to port the cmake commands to a Tcl interpreter.  Please let me know if you are interested.

Regards,

Juan



-----Original Message-----
From: cmake-bounces+juan.sanchez=amd.com at cmake.org on behalf of Bill Hoffman
Sent: Thu 11/1/2007 8:03 PM
To: Brandon Van Every
Cc: cmake at cmake.org
Subject: Re: [CMake] improve the CMake language?
 
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

_______________________________________________
CMake mailing list
CMake at cmake.org
http://www.cmake.org/mailman/listinfo/cmake



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20071101/919020db/attachment.htm


More information about the CMake mailing list