Live data from Hacker News

An Introduction to Modern CMake

cliutils.gitlab.io

41–43 of 43 posts

Re: An Introduction to Modern CMake

#41

I'm a person who has been easing into CMake use over the past few years. Something I've noticed is that there is no such thing as a single good introduction : * CMake itself is changing. While the "revolution" of modern CMake is upon us already from version 3.0 (or a little earlier), a bunch of thing change with versions 3.12, 3.13 etc. See: https://youtu.be/y7ndUhdQuU8 * Different treatments - a mini-website, PDF pr…

> * There are a half-dozen different ways to have your project depend on on other code... And this "tutorial" skips mentioning this and bluntly suggests the dummiest - git submodules.

Re: An Introduction to Modern CMake

#42

Nice to see a CMake guide here, but I don't see any discussion of generators at a cursory glance, even in the "IDEs" section. CMake is used a lot in embedded development with large or cross-platform projects, like an RTOS or the famous ESP-IDF. Unfortunately, the embedded development space is a messy hodge-podge of IDEs. There are shiny commercial ones like Keil which support most kinds of devices, but most vendors a…

I've built and maintained a generator for one of those vendor-specific eclipse IDEs. It was an absolute nightmare I don't recommend to anyone, but not for any of the reasons you'd imagine. CMake itself is easy to build / read. Implement a few functions and you'll quickly have something workable. The issues came from elsewhere: * None of the graphical CMake tools allow you to select the CMake binary, so you'd get user…

Interesting perspective, thanks for sharing your experience! That doesn't sound too much worse than working with modern CMake build systems, but it also doesn't sound mucn better.

>People put meaningless, nonsensical junk in their CMake files and expect it to output something that builds. Doesn't matter that the build script or the IDE are fundamentally broken, people just want the output so they can get back to their work.

When you put it that way, maybe that's my real pet peeve with CMake in big projects :)

Re: An Introduction to Modern CMake

#43
post #13
post #5

Don't use cmake for new projects. You'll regret it. Try meson instead: https://mesonbuild.com/

Doesn't meson bring in all of python3 as a dependency for a project? Similar to scons. (It's been a while since I did semi-serious C++, maybe nowadays we're playing a bit more loose with deps and polyglot setups)

Does that matter? CPython comes preinstalled on basically every Linux distribution as a dependency for some other program these days.
Post reply on HN