[CMake] An observation about CTest

Chris Hillery chillery-cmake at lambda.nu
Sun Jun 27 17:09:38 EDT 2010


CMake 2.6 supports functions as well. CMake 2.4 doesn't, however.

I think your initial point is good one, though. There is still a significant
dependence on global variables in CMake and especially CTest. Additionally,
as has been discussed, there's not even a completely consistent naming
convention for those variables, nor is the documentation anything like good
enough at covering everything. It really is a significant barrier to entry.

It's unfortunate, but I don't know that it can be fixed, really. CMake puts
a great deal of effort into backwards compatibility, and changing away from
global variables or at least having a massive rename-fest would be difficult
to achieve with anything like compatibility. Perhaps CMake 3.0 could have a
clean break...

Ceej
aka Chris Hillery

On Sun, Jun 27, 2010 at 1:52 PM, Convey, Christian J CIV NUWC NWPT <
christian.convey at navy.mil> wrote:

> Hi Alan,
>
> Thanks, I wasn't aware of the shift towards the use of FUNCTIONs.  Because
> of the developers I need to support, I've been mosting working with CMake
> 2.6.  I didn't realize that this was one of the things 2.8 brought to the
> table.
>
> - Christian
>
> > -----Original Message-----
> > From: Alan W. Irwin [mailto:irwin at beluga.phys.uvic.ca]
> > Sent: Sunday, June 27, 2010 16:49
> > To: Convey, Christian J CIV NUWC NWPT
> > Cc: alokgovil at hotmail.com; cmake at cmake.org
> > Subject: Re: [CMake] An observation about CTest
> >
> > Your remarks focus on old-fashioned macros so it is possible
> > you are not aware of functions? As far as I know, most or all
> > macros can be replaced by functions which do have the nice
> > property of not polluting the global namespace.  So newly
> > developed build systems should use functions wherever
> > possible, and certainly for old CMake-based build systems I
> > am associated with I am trying to move to functions as time permits.
> >
> > Here are some rough counts of functions and macros actually
> > contained in 2.8.x:
> >
> > irwin at raven> grep -i function cmake-2.8/Modules/*.cmake |grep
> > -v '#' |wc -l
> > 263
> > irwin at raven> grep -i macro cmake-2.8/Modules/*.cmake |grep -v
> > '#' |wc -l
> > 337
> >
> > Those numbers should be divided by roughly a factor of two
> > (because of ENDFUNCTION and ENDMACRO) to get approximate
> > counts of functions and macros.
> >
> > Clearly, the replacement of macros by functions is well on
> > its way for 2.8.x, but the process is still far from
> > completed.  Once it is complete, however, the global
> > namespace will be much less polluted.
> >
> > Another namespace remark is that subdirectory variables do
> > not pollute the global namespace of their parent directories.
> >
> > So the global namespace pollution issue is not as bad as you
> > have outlined and because of functions is steadily improving.
> >
> > Alan
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100627/4956d527/attachment-0001.htm>


More information about the CMake mailing list