[Cmake] Adding a debug switch with CMake

Bill Hoffman bill . hoffman at kitware . com
Wed, 11 Jun 2003 08:43:12 -0400


Part of it is the cross-platform requirements of CMake.
Make is very limited in what it can do.  For example
"+=" and "if" are not supported by all makes.   Also, some
compilers do not like to mix debug and release code, so
having them in the same build tree, and only turning it on
for a sub-part of the tree could cause link errors.   

The main problem is the limitations of make.   We tried
to implement a make verbose, but it can not be done without
an "if" which all the makes do not have.   All the complicated
stuff has to be done by cmake.

make debug could be made to work, but it would require quite
a bit of re-write in the unix makefile generator.   We have
talked about having some sort of make Debug, make Release, operations
that would work more like the windows IDE systems that build into
Release and Debug sub-dirs.    

The other problem we have is that we are generating makefiles, and 
it is likely that we will not be able to write a makefile that does 
everything that people have done in the past with make.

CMake generated makefiles are closest to GNU tools autoconf approach
where you  generate a debug or release tree using out of source builds.

Here is a makefile fragment from gcc:
# These flag values are normally overridden by the configure script.
CFLAGS = -g
CXXFLAGS = -g

So, when you run configure with different arguments it sets the C anc CXX flags.


-Bill


At 01:24 AM 6/11/2003, Neil Killeen wrote:

>In fact I think there is a whole pile of things I would
>like to do in this way without having to reconfigure CMake
>and regenerate makefiles
>
>E.g.
>
>make debug
>make verbose
>
>etc and then you might even like to add your own arguments
>on the command line
>
>make CMAKE_CXX_FLAGS+="-O1"
>
>and so on.
>
>Perhaps the cross-platform requirements on CMake make
>this kind of approach intractable ?
>
>cheers
>Neil
>
>_______________________________________________
>Cmake mailing list
>Cmake at public . kitware . com
>http://public . kitware . com/mailman/listinfo/cmake