Cmkr – a modern build system based on CMake and TOML

gjvc | 18 points

Do we really need to wrap more crap around cmake? It's already wrapping make in an unknowable way, and this layer doesn't help. The challenges when using these things aren't in writing the thing, it's fixing it when it doesn't work, understanding the error messages, etc, etc. Each layer of crap is a huge step backwards. What would you say to the cowboy that will wrap cmkr in another layer of indirection?

dima55 | 12 days ago

Yo dawg, I heard you like generating build scripts, so we put a generator in your generator so you can generate while you generate.

wheybags | 12 days ago

I think Cmkr fails to state its value proposition by focusing on how it works.

Any system like CMake that wraps boatloads of complexity is going to have unexpected interactions and inscrutable failures.

The question for any developer who doesn't want to become a build system guru is whether they can take a happy path far from any gotcha's.

That's when people start defining conventions to solve classes of problems: follow this template to do X, and you'll be fine.

The value of Cmkr lies in being about to define those conventions and happy paths. I should be able to inspect their templates, and if one fits, I'm good to go.

Even nicer would the ability to retrofit my build to a known-working template.

But Cmkr only presents the "beginners" template repo as an aside, and says nothing about whether these templates are tested for various projects on various systems.

By not explicitly identifying the problem it's trying to solve, Cmkr seems to have bumped up against a solution accidentally, and doesn't give me confidence. I believe that could be easily remedied.

w10-1 | 12 days ago

A build generator for a build generator? Oh boy. This is starting to feel like the JavaScript ecosystem.

izoow | 12 days ago

I think this is being misunderstood, partially because of the self-claim that this is a build system.

The CMake DSL is utter garbage. From my understanding, this converts TOML that follows the same/similar naming as CMake commands/options to CMake DSL. Allowing for total compatibility with CMake while avoiding the pain of actually interacting directly with a CMakeLists.txt.

Most people agree that CMake is not a good option but the only real option. I'd happily put lipstick on this pig.

bangaladore | 11 days ago

Looks like it's a declarative CMake so you don't have to interact with the CMake DSL yourself. Which is nice, but I've rarely had a non-sample/toy CMake project where I didn't have to hack something outside of the straightforward steps the docs make it look like you need to do, so my number concern with this is that it's going to end up being a (very) leaky abstraction. How much will cmkr get in the way and make it harder than if you had written out the CMake yourself to begin with? How much of the time will it "just work" vs end up being of little use?

It's great that it's self-bootstrapping, though. I thought they would have you install both this tool and CMake in order to build the project on end-user's machines.

ComputerGuru | 12 days ago

After working as a C++ developer almost all my career I am moving away from it, so I do not follow it as much. I heard that C++ modules are a step forward and a step back. Don't remember the exact criticism.

Is there a build system where one would point to a one source file and it would find its way around the whole thing? Things it wouldn't be able to deduce would be given as a comment or some preprocessor fluff. Basically implementing module system. Or maybe I did not think it through too much.

hawski | 11 days ago

Cmkr appears to be a TOML wrapper around CMake. At its current stage of development it only appears to be wrapping the most basic features of CMake (registering binaries and such).

Just my two cents but most of my time spent with build systems isn't on the basics. Most of my time is spent scripting things: probing for dependencies, build hooks, packaging, code signing, and other misc tasks. Right now cmkr doesn't appear to support scripting. I'm unsure a declarative language like TOML will suffice. Might I recommend you research premake which is a build system based on Lua. Lua is a good choice because of its scripting flexibility.

hgs3 | 11 days ago

Why dont C++ devs just write their code in CMake? Would probably solve the build system issue.

arberx | 12 days ago

Don’t you love meta-meta-build systems?

anony123 | 11 days ago

Omg another C++ build system. Who woulda thought we needed another.

arberx | 12 days ago