CMake KDE release
neundorf at kde.org
Mon Jan 30 17:44:22 GMT 2006
On Monday 30 January 2006 08:26, Simon Hausmann wrote:
> I can identify three problems:
> 1) It's inconsistent, see paragraph at the end of this mail. There's a
> reason why other programming languages avoid redundant terms unless they
> improve readability.
> ) It's error-prone. You can be sure that most people will frequently forget
> to adjust the else and endif part when changing a condition. It wonderfully
> combines with typos people are going to make in the repetitions:
> IF (NOT APPLE AND WIN32 OR UNIX AND DEFINED HAVE_GETENV)
> IF (APPLE OR WIN32)
> ENDIF (APPLE OR WIN32)
> ELSE (NOT APPLE AND WIN32 OR UNIX AND DEFINED HAVE_GETVN)
> ENDIF (NOT APPLE AND WIN32 OR UNIX AND DEFINED HAVE_GETENV)
> If I understand the mail at
> correctly, then cmake doesn't even warn about the typo in the above
> construct because the condition in ELSE is actually evaluated! That's a
> recipe for bugs.
The mail you mentioned is more than three years old.
It contains the following words: "I'll take a stab at changing
it later today."
So before stating that that's a recipe for bugs, a quick test would have
$ cat CMakeLists.txt
$ cmake .
CMake Error: Error in cmake code at
ELSE An ELSE command was found outside of a proper IF ENDIF structure. Or its
arguments did not match the opening IF command.
-- Configuring done
So, no chance for this kind of bugs.
> For someone trying to learn the KDE platform it does not matter whether the
> build system uses a full fledged programming language or just some
> descriptive configuration file syntax. What matters is that the syntax is
> intuitive and consistent. I don't believe the cmake way of repeating the
> condition in the else and endif part qualifies for that. Off-hand I can't
> think of any other programming language (or configuration/macro language as
> you said) that has a similar requirement for conditionals.
How about HTML or XML ? Basically everybody is able to write simple
IMO this is a matter of taste, there are pros and cons.
If I would have designed the cmake IF/ELSE/ENDIF commands, I wouldn't have
implemented the way it is now with requiring to repeat the argument of the
Still, I'm using cmake now for more than two years, and this requirement was
unusual at the beginning, but has never been a real problem. You get used to
Just chose any programming language, and I'm sure you'll find in every
language things which can be considered "insane" by people who don't like
this language (be it C, C++, Java, Ruby, Python, Perl, m4, whatever).
Work: alexander.neundorf AT jenoptik.com - http://www.jenoptik-los.de
Home: neundorf AT kde.org - http://www.kde.org
alex AT neundorf.net - http://www.neundorf.net
More information about the kde-core-devel