[CMake] An observation about CTest

Convey, Christian J CIV NUWC NWPT christian.convey at navy.mil
Sun Jun 27 16:52:48 EDT 2010


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5218 bytes
Desc: not available
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100627/a1a73bec/attachment.bin>


More information about the CMake mailing list