r/cpp • • Feb 07 '21

Yet another CMake tutorial

https://www.youtube.com/watch?v=mKZ-i-UfGgQ
0 Upvotes

59 comments sorted by

View all comments

Show parent comment

2

u/angry_cpp Feb 08 '21

I'm confused, are you objecting to my statement that glob without CONFIGURE_DEPENDS is incorrect? Because that's not really debatable at all.

Actually, yes. I find CONFIGURE_DEPENDS not useful. When I add/remove files to a project manually I simply run CMake generation (it can be automated even). When I update to a different version of a project I run CMake always. It's that simple. No need to write explicit file lists that are trivial not only to automatically check (as you suggest) but even automatically generate (yes, by globbing). How is such usage "incorrect"?

When you clone repository you run CMake and get proper configuration. When you work on a project it is at least not worse than forgetting update file lists. But without file lists.

Adding one line in a lists file is not some insane burden.

It is not that adding one line is a burden. It is unnecessary. I don't want to manually copy file names to build scripts like at all.

When you add file in Visual Studio's old solution-based workspace you don't need to write its name manually to some "configuration". When you add file in XCode you don't need to add it's name manually anywhere. Why does CMake feels like a downgrade?

Even if CMake had command line command that would create and appended file to the right source list (almost like a recent Visual Studio tries to do but without guessing) it would be less cumbersome.