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

Brad King brad.king at kitware.com
Fri Jan 13 14:28:38 EST 2017


On 01/13/2017 11:45 AM, Shmuel H, wrote:
> * From the other side, programmers should be able to use a script
>   language to customize their build process.
> 
> For example, a simple declaration (pseudo code):
> cmake_libraries += {
>                                    ["name":      "myLib",
>                                     "files":         "myLib.c",
>                                     "link_type": "static"]
>                                 }

The declarative part needs to be self-standing so that it can be loaded
by an IDE, edited by the user, and saved back out in the original format
with a minimal diff.  An IDE will have no idea how to write snippets back
into a procedural script.  This is one reason CMakeLists.txt files cannot
be edited through an IDE except as text files.

My proposal is that the declarative part would have most of the build,
but with some kind of named condition/config variables.  Then the
procedural part will introspect the system to determine the values of
the configuration variables so that CMake can evaluate the conditions.

-Brad



More information about the cmake-developers mailing list