On 02/23/2012 04:08 PM, Andrea Crotti wrote:
> I really physically suffer using case-insensitive languages,

Seriously? You must be an annoyingly happy person if that's your biggest
problem in life! ;-)

> but is
> there any convention to decide
> at least when to use upper and when to use a lower case?

Variables *are* case-sensitive. Only commands, macros and functions are
case-insensitive.

> 
> For example user defined variables should be upper or lower case?

If the variables is cached, the convention is to use all-caps. A lot of
people use all-caps for all other variables too. I tend to mix them,
e.g. loop variables are quite often 1-3 lower-case letters because they
are used only very locally and their meaning is pretty clear. Anything
that is not used in a very local context is all-caps in my code.

But all of this is pure convention and personal preference...

> 
> Or what happens if I hide by mistake a CMake-defined variable? (are they
> all upper case?)

The only occasion where you can hide a CMake-defined variable is inside
a function(). Otherwise you *overwrite* it's value. And you often want
to actually do that (e.g. to set the output directories for executables,
libraries, archives etc.).

HTH

Michael
--

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

Reply via email to