[Cmake] What I don't understand about CMake

William A. Hoffman billlist at nycap . rr . com
Wed, 12 Nov 2003 10:27:06 -0500


CMake IS required to be installed by the end users.  

Here is the explaination. The only tool that is really shared across all
platforms is the c/c++ compiler.  The build system can not depend on "common"
tools because there are none.  A typical configure script depends on:
sh, sed, echo, /dev/null, test, chmod, hostname, and cat.  In short,
a fairly complete UNIX environment.  So, CMake depends on the one common
tool, the c/c++ compiler.   It was felt that for a c/c++ project this would not
be too much to ask. The union of available shell functions is very small across 
windows and UNIX.  CMake is in a sense a small portable shell.  

It really comes down two this.  With autoconf, windows users must install
a UNIX compatibility layer like cygwin or mingw, and they can not use IDE build
tools, but must use command line make.   With CMake, both windows and UNIX
users have to install one program CMake, and after running cmake can use
the system build tools. 

It really would not work very well to generate makefiles and move them
to a different machine.   CMake finds all the paths for a particular machine.
And if all machines were the same, we would not need cmake or autotools.

One solution, might be to include some sub-set of cmake sources inside a project,
and build it.   However, many projects depend on gnu make and do not include
the source or build gnu make for each project.  They just expect users
to download and install gnu make first.  


-Bill



At 10:06 AM 11/12/2003, Stefano Barbato wrote:
>I read CMake documentation and examples but there's something I don't 
>understand about CMake.
>
>I think that what's good about autotools is that the build environment can be 
>shipped with the source package because of its small size but CMake is big to 
>distribute with all packages. 
>
>So I thought that CMake had to be installed on developers machines and that 
>with a single command it could generate *all* supported platform-native 
>makefiles or project files that would be included into distribution packages. 
>Probably a small auto-compiling program able to choose between generated 
>makefiles/prjfiles (based on on-site tests) could be easily included into the 
>distribution source archive (I used this approch when coding my simple unit 
>testing engine where the engine core is distributed as source file and 
>auto-compiled on end-user machine before anything else).
>
>But my CMake installation seems to be able to generate only my platform 
>Makefiles.
>
>So must CMake be installed on destination end-user PCs for them to be able to 
>compile? can CMake generate all supported makefiles and project files at 
>once? Does this message make any sense? :)
>
>Thanks.
>
>Stefano Barbato
>
>_______________________________________________
>Cmake mailing list
>Cmake at www . cmake . org
>http://www . cmake . org/mailman/listinfo/cmake