CMake Made East

Started by
7 comments, last by SeanMiddleditch 8 years, 5 months ago

Hey Guys!

Whilst helping my friend learn C++ I wanted an easier way for him to manage libraries and set up projects. This lead me to start development on a python script which provides a layer of abstraction to the CMakeLists.txt file.

I've only recently started development on it but I am excited at its potential. To see what I mean, take a look at my blog post:

http://blog.nickcullen.net/2015/11/cmake-made-easy-first-look.html

I intend to port over my CMake scripts for my game engine to these once development is complete. I'm trying to complete one project a month, so hopefully it won't be too long!

If you want to follow along (or maybe even contribute) you can find the repo on Github:

https://github.com/NickCullen/cmakeconf

Also... This is my first post - Hello! smile.png

EDIT:: Oh man... first post and I put a typo in the title!! It was meant to say "CMake made easy" (facepalm)

Cheers,

Nick

Game Developer based in Swansea, South Wales (UK).

http://nickcullen.net

Advertisement
And this is why everyone should just say No to CMake. tongue.png

When you need a generator for you build system generator, the latter has utterly failed at its one job.

Your work is good, I'm not disparaging that! Just the over-hyped pile of garbage that is CMake. smile.png

Sean Middleditch – Game Systems Engineer – Join my team!

And this is why everyone should just say No to CMake. tongue.png

When you need a generator for you build system generator, the latter has utterly failed at its one job.

Your work is good, I'm not disparaging that! Just the over-hyped pile of garbage that is CMake. smile.png

Haha yes describing this concept to a friend as a "generator for a generator" was quite amusing! But I do believe it abstracts it well enough to simplify the experience of using CMake!

Someone has just pointed out biicode to me, a C/C++ dependancy manager which sounds very interesting (coincidently is also a generator for CMake) which I shall be taking a look at over the next few days. It uses the same sort of config file syntax but with a package manager built onto it :)

Cheers,
Nick

Game Developer based in Swansea, South Wales (UK).

http://nickcullen.net

Did you consider extending cmake itself, as in, submitting patches to the project?
No idea about feasibility though.

@SeanMiddleditch
I fully agree, Cmake is however the least worse solution to multi-platform build stuff afaik, unless I am missing something?


I fully agree, Cmake is however the least worse solution to multi-platform build stuff afaik, unless I am missing something?

Eh. I still use CMake for a couple of projects, but it's not anywhere close to ideal. What it does do is let me very quickly have Windows/Linux/Mac builds up and running, but in the end, it doesn't integrate perfectly with the tools on *any* of the platforms, which means I'm spending a bunch of time tweaking CMake instead of making one-line IDE fixes.

I've also gone down the route of maintaining 3 full build systems (Visual Studio for Windows, XCode for Mac, Makefiles for Linux), and while it's a little more effort to keep synchronized, I think it's actually a more sane direction for a single-developer project.

That or just work in something like Unity, that has all the cross-platform toolchain stuff out of the box...

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

I love qmake, but despite it being cross-platform, I only have experience with it on Windows so I can't comment on how well it works on the other systems.

And this is why everyone should just say No to CMake. tongue.png

When you need a generator for you build system generator, the latter has utterly failed at its one job.

Your work is good, I'm not disparaging that! Just the over-hyped pile of garbage that is CMake. smile.png

What would you recommend for this then?


Did you consider extending cmake itself, as in, submitting patches to the project?
No idea about feasibility though.

I've not looked at the source code as of yet... but maybe once I get the proof of concept working as a python tool I may take a look at including it into CMake.

Game Developer based in Swansea, South Wales (UK).

http://nickcullen.net

What would you recommend for this then?


I've been dinkering around with premake and find it far more tolerable, but haven't used it on any project of significant scale, so there's probably some fatal flaw in there I haven't encountered yet. One upshot though is that patching premake locally is far easier than patching CMake; I tried fixing a few small bugs in CMake that are huge problems for us at work and ended up giving up, which for me is saying something.

Most truly large projects I know end up having to just roll their own build system anyway, though. Even folks using CMake are essentially already doing that, as this thread indicates, and we've done as well (we have a particular need on our project for a feature that we had to roll ourselves, which we did in CMake's language; screw that noise, it was and still is a complete and absolute nightmare straight out of hell's rectum).

Generators like SCons or premake or so on, on account of using a real programming language instead of CMake's terrible home-grown mess, make it easier to just use the low-level generators as libraries while developing your own high-level front-end that meets your needs.

Sean Middleditch – Game Systems Engineer – Join my team!

This topic is closed to new replies.

Advertisement