I hate CMAKE. That's the post. Just hate it.

Why the FUCK does CMAKE generate VS project files that depend on having CMAKE installed on your system? And it has to be in a fixed path? And EVERYTHING has to be in a fixed path?

Have CMAKE developers ever compiled something or used version control? This is unusable and I am very angry and it's Monday and I haven't had my coffee yet.

#cmake #programming #cprogramming

Ok, I finally managed to make this project work on a different machine it ran CMAKE and just regenerated the project discarding all my changes.

What in the actual hell is this?

#cmake #programming #cprogramming

Show thread

@sos Isn't that's how CMake (or other tools like that) should be used?

Store CMake config on the repo, regenerate project files locally. When adding/removing files, do that in CMake, and regenerate again. That's the idea 🤷‍♂️

I'm definitely not saying it's a good idea 😅

Follow

@kkolakowski @sos It's a much better idea than having to maintain a myriad of separate build scripts for each platform and having to deal with stuff like Visual Studio or Xcode directly. CMake isn't a particularly beautiful implementation of that idea, but any other sane build system works the same way.

@dos @kkolakowski Why is it so bad with Visual Studio then?

It tries to solve a problem that didn't exist.

@sos @kkolakowski Is it though? All I can see here is you trying to use a tool blindly without understanding what it's for :P
It's a build solution generator, and VS project files are merely one of the kinds of outputs it does (alongside Ninja, Make, Xcode and plenty of some obscure ones too). Generated files are just intermediate build artifacts - you use them to build, they're not for human consumption nor for editing.
It's simply an abstraction on top of various incompatible build systems.

@sos @dos @kkolakowski the misunderstanding seems to be what the generated .sln is when targeting vc, it's the intermediate file, it shouldn't be used directly as any changes to it won't be saved. You should just be setting variables in the cmakelists.txt file so the generator you're using can manage the files (that should be the only "project" file you store in the repo, most modern ide's can directly use it as well)

NOTHING in the build folders should be in vcs, those are system dependant

@raptor85 @dos @kkolakowski But I wan t to use VS to do actual work. You guys have no IDES?

@sos @dos @kkolakowski I do, but you use the CMake files as the project file, every IDE i've ever used supports this, the sln is generated for your system specific toolchain so you don't have to modify settings every computer you load it on and just used in the background. Like if you want to add a library, don't directly add the library the VS way, use the cmake variables so that it can generate a VS project, ninja build, etc for ANY ide.

@raptor85 @dos @kkolakowski

"you don't have to modify settings every computer you load it on"

Well, if I want to put /Qpar setting for VS and -ffast-math for GCC I still have to put them both, I don't see what is the benefit here.

@sos @dos @kkolakowski because even if you specify special settings for different compilers you still don't have to write a build script for every toolchain/build system/version imaginable, it generates a build directory with the correct build/project files based on what the USER has installed, for instance I can use ninja or automake as the final build system no matter what GCC flags you set, it's up to how my local toolchains are configured.

@sos @dos @kkolakowski don't think of it like a replacement for .sln, automake, whatever, it's not, it's a scripting language to automate generating those based on variables you set so you don't have to cater to everyone's setup, you're abstracting the actual build system to make it easier to port to different toolchains.

@raptor85 @sos @kkolakowski CMake is a leaky abstraction with awful DSL, and my 12yo cmake scripts are a pile of incredible mess riddled with technical debt, but it still does its job well enough that I could just point my projects to stuff like devkitpro, vitasdk, osxcross, Emscripten, Flatpak or Steam Runtime and focus on actual porting rather than fighting with build recipes.

@dos @sos @kkolakowski yup, and most IDEs are smart enough to automatically generate build folders for your local toolchains so I can pull in pretty much any cmake file and get build targets for both linux x86_64 and a windows cross compile with mingw. To add new targets to all my projects I don't have to write tons of new scripts, just add a new toolchain to my system and they ALL get it.

@sos @raptor85 @kkolakowski To do actual work, we have proper IDEs that can handle such exotic and rarely-seen things as CMake projects (/s) natively 😂

@dos @sos @kkolakowski yup, and with cmake projects you should always try to use the actual variables, not specific compiler/etc overrides unless necessary as those are better off as settings in the local toolchain, not the project file (for instance for -ffast-math you may not want that on in a debug build or the user may want it disabled for an embedded processor)

Sign in to participate in the conversation
Librem Social

Librem Social is an opt-in public network. Messages are shared under Creative Commons BY-SA 4.0 license terms. Policy.

Stay safe. Please abide by our code of conduct.

(Source code)

image/svg+xml Librem Chat image/svg+xml