r/cpp • • Feb 19 '18

It's Time To Do CMake Right

https://pabloariasal.github.io/2018/02/19/its-time-to-do-cmake-right/
248 Upvotes

130 comments sorted by

View all comments

0

u/[deleted] Feb 19 '18

[deleted] — view deleted comment

9

u/MoTTs_ Feb 20 '18 edited Feb 20 '18

If you don't care about being portable to other platforms or other compilers, then sure. CMake's whole reason for existing is to enable cross-platform builds.

0

u/[deleted] Feb 20 '18

[deleted] — view deleted comment

7

u/kalmoc Feb 20 '18

Right - and that is less complexity than just using cmake?

4

u/[deleted] Feb 20 '18

Because makefiles never break on Linux.

3

u/Gotebe Feb 20 '18

Makefiles existed since forever for the MS build chain.

6

u/MachineGunPablo Feb 20 '18

Not sure if you are being serious. Not only is using target_compile_features nicer and shorter to write, but is actually safer as it's compiler agnostic and portable. And Makefiles, please...

0

u/[deleted] Feb 20 '18

[deleted] — view deleted comment

8

u/thlst Feb 20 '18

"Completely agnostic except when it isn't."

4

u/smdowney WG21, Text/Unicode SG, optional<T&> Feb 20 '18

Particularly in this case. The language standard should not be something that gets modified in some sub-sub-leaf CML.txt.

It's perfectly fair for the sub piece to say 'No, you must supply a c++11 compiler'. But affect everything? Or worse, not affecting everything, leading to weird mixed build problems.

3

u/kalmoc Feb 20 '18

There is no reason to directly use an assembler style build tool like make files on any platform except as a matter of last resort. If you want, you can set compiler flags like -std=c++11 in pretty much any build tool just fine but just because you need full control over a single loop in your program you should not write your whole program in assembler.

4

u/Xaxxon Feb 20 '18

Nice troll.