[CMake] An observation about CTest

Michael Wild themiwi at gmail.com
Mon Jun 28 02:55:05 EDT 2010


On 28. Jun, 2010, at 7:03 , Andreas Mohr wrote:

> Hello,
> 
> On Sun, Jun 27, 2010 at 05:09:41PM -0400, cmake-request at cmake.org wrote:
>> 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.
> 
> That's all fine and dandy (and you've written some nice prose about
> it :), but I've just been reading man cmakecommands of Debian cmake
> 2.8.1-5(!) from top to bottom and bottom to top, and nowhere does it
> mention _any_ underlying difference between macros and functions.
> 
> Not even I knew about this difference, despite having almost a month-full
> of rather very internal CMake experience (Google searches in the couple
> hundreds, vcproj2cmake adaptation of a _large_ project etc.).
> 
> Suggestion for the sake of world peace: I'll submit a patch for that man
> page, ok? :)
> 
> Andreas Mohr
> 

You are right, the docs don't mention that FUNCTION introduces a new scope, which should be fixed. But it should be clear from the traditional use of the names. Macros are textual replacements (just as in C), functions have their own local scope (again, just as in C). 



More information about the CMake mailing list