[Cmake] Strange
Miller, James V (Research)
millerjv at crd.ge.com
Fri Aug 9 14:08:13 EDT 2002
The drawback to the current syntax is that people look at
ELSE (WIN32)
and think ELSEIF and not ELSE
So I think it would be clearer if the syntax could be
IF (FOO)
ELSE # FOO
ENDIF # FOO
'Course I would prefer the syntax to be
IF (FOO)
ELSE
ENDIF
Or maybe even
IF (FOO)
{
}
ELSE
{
}
Like all the other languages that are near and dear to my heart. 'Or you could adopt the python
indentation style....
-----Original Message-----
From: Ken Martin [mailto:ken.martin at kitware.com]
Sent: Friday, August 09, 2002 1:48 PM
To: Miller, James V (Research); CMake developers (E-mail)
Subject: RE: [Cmake] Strange
Yes I believe the arguments to ELSE and ENDIF could be made optional. Same for the ENDFOREACH
command. Making them required does force people to document their files. In C/C++ long if statements
are easier to read if they are written as:
if (win32)
{
}
else // win32
{
} // win32
The current syntax forces people to do this. I can relax this syntax and let people do
IF (WIN32)
GOOBER()
ELSE () # WIN32
GOOBER()
ENDIF () # WIN32
but then the comments can get out of sync with the actual IF. The current syntax makes sure they stay
consistent. I'm open to discussion although my leaning would be to leave them as required.
Thanks
Ken
Given the correction to the ELSE command, is there any chance that the arguments to ELSE
and ENDIF can be eliminated. It is confusing to people to see an IF and an ELSE with the
same condition (arguments).
Jim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20020809/109235ee/attachment.html>
More information about the CMake
mailing list