top | item 27277448

(no title)

wmkn | 4 years ago

CMake as a library with bindings for various scripting languages (e.g. Python) would make a lot of sense to me. Have the power of a proper scripting language and let the CMake library deal with generating the build system.

I once looked into extracting the CMake build system generation code and make it into a standalone library. But I soon realized that it’s not exactly a weekend project.

discuss

order

mathstuf|4 years ago

Again, the way the language works is baked deep into the project. The stringly-typed nature is everywhere. Using Python isn't going to magically fix that list elements that contain `;` "don't work right". Policy scoping is weird and is not lexical (e.g., policies "stick" to function definitions, so calling a function can cross a policy boundary).

It's one of those "ah, that sounds nice" things that is just too much work once you get down to it (and we have enough compatibility to handle without dealing with the vagaries of umpteen languages as it is).

rualca|4 years ago

> CMake as a library with bindings for various scripting languages (e.g. Python) would make a lot of sense to me.

Well, if your thing is fragmentation and bit rot and maintenance hell, sure.

There were plenty of competing build systems for C++ that provided Python bindings, such as SCons. For some reason, CMake with its awful BASIC-like DSL became the de facto standard.