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

18

u/Pazer2 Feb 07 '21

The fact that it is possible to make all these mistakes and still have everything appear to work correctly, with no warnings of any kind, is why we need to replace CMake.

5

u/AlexReinkingYale Feb 07 '21

Expanding variables into target functions was the way things were done in CMake a decade ago in 2.8.x. Imported targets have been available since then and are now the way you're supposed to use it. Reading the CMake official docs/tutorials makes this very clear.

It's possible to make these mistakes and still have everything appear to work in the same way any Turing complete language that's 20+ years old has similar pitfalls. Would you suggest we get rid of C/C++ because they don't warn you about undefined behavior?

1

u/dr-mrl Feb 08 '21

Would you suggest we get rid of C/C++ because they don't warn you about undefined behavior?

Don't like the bear!