Re:Using CMake and Managing Dependencies
by flohofwoe on Tuesday May 25, 2021 @09:17AM
(#27276412)
Agreed. What cmake does under the hood is actually very sensible and useful, but the arcane scripting language makes even simple things hard. Adding a "proper" alternative scripting language would be a good reason to bump the version number to 4.0
[ Parent
| on HN ]
Re:Using CMake and Managing Dependencies
by klapatsibalo on Tuesday May 25, 2021 @09:20AM
(#27276432)
Let's make a language that compiles to CMake! :D
Let's call it Autocmake.
Re:Using CMake and Managing Dependencies
by MaxBarraclough on Tuesday May 25, 2021 @10:28AM
(#27277211)
Or perhaps CTools.
...or CMake Development Kit (CDK)
It is serviceable after time, and if you don't need nothing too fancy. Just remember that basically everything is a string.
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.
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).
> 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.