<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, May 15, 2014 at 10:15 AM, Eric Noulard <span dir="ltr"><<a href="mailto:eric.noulard@gmail.com" target="_blank">eric.noulard@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">2014-05-15 10:08 GMT+02:00 Nicolas Desprès <<a href="mailto:nicolas.despres@gmail.com">nicolas.despres@gmail.com</a>>:<br>


<div class="">> Hi,<br>
><br>
> I am planning to develop a python generator of CMakeLists.txt file for<br>
> easier integration in an already existing tool. This approach is different<br>
> from the others approaches consisting in binding the CMake language in a<br>
> foreign languages. Lua, Javascript and Python have already been tried<br>
> without success to my knowledge. Generating CMakeLists.txt files seems a<br>
> simpler approach to me since the CMake language is very stable and it keeps<br>
> the two projects separated. Finally it reaches the same goal since the idea<br>
> behind binding CMake in a foreign language is too gain a more general<br>
> purpose and feature full language with a larger standard library.<br>
><br>
> To assist in such a task the CMake language could provide a command similar<br>
> to the #line directive found in the C-pre-processor. Changing the filename<br>
> and line number in the CMakeLists.txt file would make the generator able to<br>
> transparently run CMake behind the scene while the errors reported by CMake<br>
> would still refer to the generator input file written by the user.<br>
><br>
> The last time I checked I could not find such a feature in CMake.<br>
<br>
</div>Did you check those var:<br>
CMAKE_CURRENT_LIST_DIR<br>
CMAKE_CURRENT_LIST_FILE<br>
CMAKE_CURRENT_LIST_LINE<br>
<br>
message(STATUS "${CMAKE_CURRENT_LIST_LINE}: ${CMAKE_CURRENT_LIST_FILE}<br>
Your message")<br>
<br>
should print the line number and filename with "Your message".<br>
<br>
Is it the kind of feature you are looking for?<br>
<div class=""><br></div></blockquote><div>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. </div>

<div><br></div><div>[...]</div></div><div><br></div>-- <br>Nicolas Desprès<br>
</div></div>