[cmake-developers] [PATCH v4 0/3] Add continue keyword
Brad King
brad.king at kitware.com
Mon Nov 17 14:39:52 EST 2014
On 11/17/2014 02:00 PM, Gregor Jasny wrote:
> the current version now properly checks for proper nesting
> of the continue keyword.
Cool, thanks.
> 1) The Scope variable stack is held in a 'internal' structure
> that gets special treatment in the cmMakefile copy ctor.
> I don't know the implications of storing my loop block
> counter stack directly as member of cmMakefile. Could you
> please advise?
IIRC the cmMakefile copy ctor is used in CPack, but only in a
context where nothing but the top-level scope is in place.
You should be able to store the member in cmMakefile.
> 2) The error message for an inproperly nested continue looks
> like this:
>
> continue A CONTINUE command was found outside of a proper FOREACH or WHILE
> loop scope.
>
> where is the continue coming from? Is it part of a (too short)
> call stack trace? Also I noticed that the CMakeFile is still
> processed after the error is shown. Is this desired behavior?
It comes from use of SetError and "return false", the old error
reporting mechanism. Instead you can do:
this->Makefile->IssueMessage(cmake::FATAL_ERROR, ...);
cmSystemTools::SetFatalErrorOccured();
return true;
> 3) The continue tests have a requirement for CMake version 3.1
> in the CMakeLists.txt file. This needs to be bumped to 3.2 once
> the the version number got incremented to 3.2.
You can use a dated version like 3.1.20141117 to request a dev
version.
> 4) Is the new policy to reject misplaced break() commands really
> necessary?
Yes, we need old code to continue to work even if it is wrong in
this regard.
Thanks,
-Brad
More information about the cmake-developers
mailing list