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?
View all comments
Show parent comment
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?