673

Which will probably be never.

top 50 comments
sorted by: hot top controversial new old
[-] Asudox@lemmy.world 39 points 1 month ago* (last edited 1 month ago)

I mean, all cmake does is run some commands for you. You not understanding cmake errors (mostly) means you don't understand the errors given to you by the C/C++ compiler.

[-] jupyter_rain@discuss.tchncs.de 42 points 1 month ago

Partly, yes. But I also think their documentation is a bit hard do read. Maybe this will get better with time.

[-] Asudox@lemmy.world 44 points 1 month ago
[-] 30p87@feddit.org 6 points 1 month ago

I use distcc, and do not have to take vacation for my programs to finish compiling.

[-] Asudox@lemmy.world 9 points 1 month ago* (last edited 1 month ago)

If it means my code won't panic out of nowhere and cause a disaster for me, I am willing to "take a vacation" for my program to finish compiling.

[-] marcos@lemmy.world 10 points 1 month ago

Maybe this will get better with time.

Yes, just give it a few more decades.

[-] paperplane@lemmy.world 26 points 1 month ago

CMake can also emit its own errors during the configure step though, particularly if you have complicated build logic and/or lots of external packages.

[-] aaaaaaaaargh@feddit.org 35 points 1 month ago

Did you know that there is a debugger in Jetbrains CLion (and I think VS as well) that allows you to step through your CMake scripts? As ridiculous as this may seem, actually it is really useful.

[-] jupyter_rain@discuss.tchncs.de 8 points 1 month ago

Even in VS? Nice, gonna check that out.

[-] aaaaaaaaargh@feddit.org 10 points 1 month ago

Yeah, I wasn't aware of that until I found this article claiming it to be available.

[-] KindaABigDyl@programming.dev 29 points 1 month ago

Life is and will always be better writing your own Makefiles. It's literally so easy. I do not get the distaste. Cmake is arcane magic. Bazel is practically written in runes. Makefile is a just a glorified build script, but where you don't have to use a bunch of if statements to avoid building everything each time.

[-] TheReturnOfPEB@reddthat.com 15 points 1 month ago* (last edited 1 month ago)

really anyone worth their salt should write perl code to generate makefiles depending on the phase of the moon and if you sacrificed a $chicken, a @chicken, or a %chicken at runtime.

[-] leggettc18@programming.dev 6 points 1 month ago

That works until you need to support Visual Studio or Xcode. Then you either maintain their stuff manually too, or you get CMake to generate all three. I don’t love it but it solves the problem it’s meant to solve. The issue is people using it when they don’t need to.

[-] Hack3900@lemy.lol 3 points 1 month ago

I'm not familiar with either why can't you use Make with VS or Xcode? Can you not set them up to have whatever build bind call Make ?

[-] zaphod@sopuli.xyz 3 points 1 month ago

Xcode implies MacOS, you can use make there too, just beware that some commandline tools take different arguments on BSDs.

[-] KindaABigDyl@programming.dev 1 points 1 month ago

You can build with mingw64 built with msvc and use more or less the same Makefile. As for Xcode... well, there's not really a good reason to support Mac. On principle I wouldn't even try

[-] CanadaPlus@lemmy.sdf.org 6 points 1 month ago* (last edited 1 month ago)

It's one of those massively elegant concepts of the past that's become unfashionable to learn pretty much just do to time and ubiquity.

[-] Socsa@sh.itjust.works 4 points 1 month ago

Manual makefiles don't scale though and you end up needing some other bootstrap framework pretty quick.

[-] KindaABigDyl@programming.dev 1 points 1 month ago

How the heck does a Makefile not scale??? That's all it does!

[-] WormFood@lemmy.world 3 points 1 month ago

this is fine until you need autotools which is worse than cmake

[-] thenextguy@lemmy.world 23 points 1 month ago

Grab a brush and put a little cmakeup.

[-] ripcord@lemmy.world 4 points 1 month ago

Wrong class, you'll need cbrush.

[-] MajorHavoc@programming.dev 13 points 1 month ago* (last edited 1 month ago)

Thanks for the laugh.

That was also my experience, but it ended when I stopped using cmake.

I'm not mad at anyone for using cmake, but I consider myself blessed on each day that I don't have to collaborate with them (on cmake).

Which is weird, because someone will have to pry a Makefile from my cold dead hands, someday.

[-] xep@fedia.io 11 points 1 month ago

The C in Cmake maybe stands for cat. It would make sense.

[-] leggettc18@programming.dev 5 points 1 month ago

In case anyone wants to know the actual answer, it stands for cross platform make, and my understanding is that it’s for generating build project files for various development environments. For instance, with one CMake file you can generate a Visual Studio Solution file, an XCode project file, a Makefile, etc. Several IDEs are also able to read CMake files directly.

[-] Socsa@sh.itjust.works 1 points 1 month ago

This thread is wild, I'm here like "cmake is by far the simplest way to cross compile to ARM and x86, with and without Cuda build targets" and y'all are talking about IDEs for some reason.

load more comments (1 replies)
[-] colournoun@beehaw.org 10 points 1 month ago

Professional CMake: A Practical Guide by Craig Scott is an excellent guide to modern cmake usage. Well worth the $30 if you need to build, maintain, or modify a CMake project.

https://crascit.com/professional-cmake/

[-] loics2@lemm.ee 2 points 1 month ago

And an update has just been released today!

[-] jupyter_rain@discuss.tchncs.de 2 points 1 month ago

Thanks a lot!

[-] witx@lemmy.sdf.org 6 points 1 month ago

This was solved by moving to bazel. It's a bit more verbose and resource heavy, but the language is sane and how you structure your build code makes a lot of sense

[-] scrion@lemmy.world 5 points 1 month ago* (last edited 1 month ago)

Based on this comment*, I'll migrate a large project to bazel now. I'll report how it goes.

  • disclaimer: the comment just pushed me over the edge
load more comments (2 replies)
[-] Socsa@sh.itjust.works 2 points 1 month ago

I have legitimately never met a single person in real life who has anything positive to say about bazel, and I assume it it because they have all killed themselves.

load more comments (1 replies)
[-] USSMojave@startrek.website 5 points 1 month ago

There are cmake debuggers where you can walk through exactly what it's doing line by line

[-] jupyter_rain@discuss.tchncs.de 6 points 1 month ago

Do you have a good one which you can recommend?

load more comments (2 replies)
[-] marcos@lemmy.world 4 points 1 month ago

Who debugs the builds of the build debugger?

[-] dgriffith@aussie.zone 3 points 1 month ago

Someone with only a tenuous grip on their sanity, I'd imagine.

[-] cupcakezealot@lemmy.blahaj.zone 4 points 1 month ago

sudo make me a cmake

[-] urda@lebowski.social 4 points 1 month ago

I’m in this photo and I don’t like it

[-] JATtho@lemmy.world 3 points 1 month ago

I never finished reading my CMake book that weights about two kilos. It's now outdated, except for the core concepts.

[-] lung@lemmy.world 2 points 1 month ago

That's like one thing ML can actually help with XD cute cat

[-] CrystalRainwater@lemmy.blahaj.zone 2 points 1 week ago* (last edited 1 week ago)

Imo just use something else. If your build system is really simple just write the Makefiles yourself. If the build system tho needs to be really complex I would use something like meson or scons (Having worked on some gigantic fully GNU make build systems it can get pretty out of hand).

This is all a personal preference thing but cmake in my experience is really non intuitive and a pain to debug. I know it works for a lot of people but I definitely prefer particularly like scons since its python I have a bit easier time understanding what's happening.

If you really need to use cmake, use a debugger like another user commented. There's also a GNU make debugger in case you need to debug makefiles

[-] nexussapphire@lemm.ee 2 points 1 month ago

I forgot to assign a variable, now it crashes %5 of the time. It's wild how c doesn't default variables to null or something.

[-] Endmaker@ani.social 12 points 1 month ago* (last edited 1 month ago)

default variables to null or something

That is such a bad idea. Better to have the compiler warn you about it like in Rust, or have the linter / IDE highlight it.

load more comments (3 replies)
[-] CodeMonkey@programming.dev 9 points 1 month ago* (last edited 1 month ago)

C does exactly what you tell it, no more. Why waste cycles setting a variable to a zero state when a correct program will set it to whatever initial state it expects? It is not user friendly, but it is performant.

[-] marcos@lemmy.world 6 points 1 month ago

Except that this is wrong. C is free to do all kinds of things you didn't ask it to, and will often initialize your variables without you writing it.

load more comments (3 replies)
load more comments (1 replies)
load more comments
view more: next ›
this post was submitted on 15 Aug 2024
673 points (98.4% liked)

Programmer Humor

19178 readers
934 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS