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

Brad King brad.king at kitware.com
Fri Jan 13 10:56:22 EST 2017


On 01/12/2017 01:20 PM, Shmuel H, wrote:
> maybe a general problem with dependencies, which generally
> make our life harder?

Yes.  People typically install CMake only in order to build something else.
If Python were added as an external dependency then that would be yet
another step.  If it were bundled then our bootstrap script and CMake-based
build of CMake itself would both have to learn to build Python.  Python
is also a distribution in addition to a language, so deploying it raises
the question of what to bundle with it.  None of these is something I'd
like to have added to the responsibilities of maintaining and distributing
CMake.

There are already other build systems that use Python as their language,
but many people still choose CMake over them anyway.

> However, for me - a user, a known and well-designed programming language
> for CMake would be very helpful. I can't say that for every other user,
> but I think it would make their life a lot easier too. 

As Charles Huet mentioned Lua is a good choice because it provides a
language and is portable to everywhere that has C.  It is also not a
distribution.  I've posted in the past a design for a cmake_lua command
that allows one to use Lua code within CMakeLists.txt files.  Actually
using it as a full replacement language though will first require more
refactoring internally as I mentioned in my previous post.

As I've mentioned in previous discussions, if we're going to go through
a language change we should make sure it addresses important needs.
Having a declarative specification that can be externally tooled will
be helpful to IDEs.  I'd envision such a format that is then imported
by the procedural-language part of the configuration process for
evaluation of conditions and finalization for the current target.

Without a comprehensive design I'm hesitant to proceed on any such effort.

-Brad


More information about the cmake-developers mailing list