[cmake-developers] [Discussion] Add python support for CMakeLists

Egor Pugin egor.pugin at gmail.com
Fri Jan 13 11:29:55 EST 2017


> One requirement for such a format is
> that it is possible for a tool to read the entire spec, make small
> modifications, and write it back out as close as possible to the
> original format.

I have such yaml formatting function for my layout.
You may see those pretty specs I've posted.
At the moment it lacks of some deep nodes formatting, but the overall
structure is preserved. See [1].

> This means a standard layout would need to be defined.

And my current layout [2] (from that function too).

[1] https://github.com/cppan/cppan/blob/master/src/common/yaml.cpp#L171
[2] https://github.com/cppan/cppan/blob/master/src/common/yaml.cpp#L196

On 13 January 2017 at 19:15, Brad King <brad.king at kitware.com> wrote:
> On 01/13/2017 11:05 AM, Egor Pugin wrote:
>> Why not just use C/C++ for writing build system (bs) rules?
>>
>> CMake first will build bs itself (e.g. into shared library) and then
>> load and execute it on the source tree.
>
> In an earlier post of this thread I said that no dynamic loading will
> be allowed.  We used to have the `load_command` command but it is now
> deprecated.  This approach simply doesn't work because we can't know
> that the toolchains can compile for CMake's architecture on the host.
> Certainly we're not going to include a C++ JIT in CMake itself ;)
>
>> I'll investigate this in my C++ Archive Network [1] project very soon.
>> Now I have mentioned here declarative (YAML) syntax with custom CMake
>> insertions. For example, see specifications [2-5].
>
> YAML may be a nice choice for a declarative spec, especially because
> it can just contain JSON too.  One requirement for such a format is
> that it is possible for a tool to read the entire spec, make small
> modifications, and write it back out as close as possible to the
> original format.  The idea is that "git diff" should only show the
> changes made by the tool.  This means a standard layout would need
> to be defined.
>
> -Brad
>



-- 
Egor Pugin


More information about the cmake-developers mailing list