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.con...@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:ir...@beluga.phys.uvic.ca] > > Sent: Sunday, June 27, 2010 16:49 > > To: Convey, Christian J CIV NUWC NWPT > > Cc: alokgo...@hotmail.com; cmake@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: > > > > ir...@raven> grep -i function cmake-2.8/Modules/*.cmake |grep > > -v '#' |wc -l > > 263 > > ir...@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 >
_______________________________________________ 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