[cmake-developers] What about #line like feature in cmake language?

Ben Boeckel ben.boeckel at kitware.com
Thu May 15 08:36:51 EDT 2014


On Thu, May 15, 2014 at 12:45:27 +0200, Nicolas Desprès wrote:
> Nope. These variables are the cmake equivalent to the __LINE__ and __FILE__
> C-pre-processor macro. What I need is the #line directive equivalent which
> force the value of these variables so that error messages reported by cmake
> uses the forced value. 

If you'd like to try a patch, the relevant code is in
Source/cmExprParser*. Add a callback for #line nnn and update the
CurrentLine variable cmExprParserHelper.cxx. Don't forget tests :) .

This will also likely need a policy since there's no guarantee that
#line "directives" don't exist in already existing code as comments.

--Ben



More information about the cmake-developers mailing list