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

Nicolas Desprès nicolas.despres at gmail.com
Thu May 15 04:08:09 EDT 2014


Hi,

I am planning to develop a python generator of CMakeLists.txt file for
easier integration in an already existing tool. This approach is different
from the others approaches consisting in binding the CMake language in a
foreign languages. Lua, Javascript and Python have already been tried
without success to my knowledge. Generating CMakeLists.txt files seems a
simpler approach to me since the CMake language is very stable and it keeps
the two projects separated. Finally it reaches the same goal since the idea
behind binding CMake in a foreign language is too gain a more general
purpose and feature full language with a larger standard library.

To assist in such a task the CMake language could provide a command similar
to the #line directive found in the C-pre-processor. Changing the
filenameand line number in the
CMakeLists.txt file would make the generator able to transparently run
CMakebehind the scene while the errors reported by
CMake would still refer to the generator input file written by the user.

The last time I checked I could not find such a feature in CMake. I am
realizing that since version 3 is still under development it might be a
good occasion to show up and mention it here. I think that it is not a big
change to CMake and that it should not overload the maintenance process. I
hope it is not too late for such a proposal since the 5th candidate has
just been released.

Best regards,

-- 
Nicolas Desprès
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20140515/48899af7/attachment.html>


More information about the cmake-developers mailing list