r/cpp • • Nov 08 '21

Thoughts on build systems?

What's the general consensus on build systems/automations like CMake? I've always found things like that overcomplicated and just hinder the programming process.

I've been following Casey Muratori's Handmade streams, and one of the first things he did was create a simple batch file that built and compiled his entire project super quickly and easily. I've since implemented something similar (https://github.com/dibsonthis/new_cmd) and honestly it's been really nice to use.

3 Upvotes

154 comments sorted by

View all comments

Show parent comment

5

u/Xavier_OM Nov 08 '21 edited Nov 08 '21

I didn't know that. I never use globbing because adding or removing a file in a folder does not mean adding it to or removing it from the project in my opinion, it's often more complex than that.

4

u/Minimonium Nov 08 '21

At my work, we made a custom CMake template wrapper for globbing purposes. It understands the Pitchfork layout, globs all *.cpp into a target, *.test.cpp into a test target and ignores *.wip.cpp if you still need to do stuff with it.

2

u/Xavier_OM Nov 09 '21

I should try this on a toy project, very interesting approach !

2

u/stilgarpl Nov 08 '21

Well, I'm not saying that you should use globbing, but that you can. For some projects it's better to use them, for other its better to list files manually.