Thanks, very helpful. I'm new to this area and have been concentrating on learning CMake, but want to know more about how the (non-meta) build systems work as well. Looking forward to other comparisons.
They always say one needs to see something worse to start to appreciate what they have. Make seems really difficult and cryptic. Can you please make a video and talk about what generator expressions are and if we can use them for both single generator systems and multi-generator systems as well?
I can consider making a video about generator expressions. They can be used for both single and multi-config generators. I don't particularly like generator expressions, because they're harder to reason about than the basic build script. They don't work with if/else, because the value in the generator only exists at generation time.
@@KeaSigmaDelta I can totally understand that, but it does seem like they work better for environments such as Visual Studio and others that are multi-config and I have no choice but to learn about them. Really frustrating.
Comparing make with cmake is useful to those who use Make directly (which I suspect is far more than use autotools). If someone does do a cmake vs autotools comparison, then please share the link here.
cmake looks less complcated than makefile, but as I use amigaos4 to buildmy little amigaos4 stuff I'm used to makefile, but maybe for laarge projects it can be a PITA.
Sadly, AmigaOS 4's CMake port is rather old, so it's not usable for newer CMake scripts. GNU Make is more complicated, but once you've got a good template, then you can usually get it up and running relatively quickly. I have no trouble using it for large projects, because adding an extra source file to an existing makefile is very easy.
would you think its worth it to rewrite makefile project into cmake? i have a cross-compile project in my comany. it is completely writen in makefile which looks hard to maintain now.
I personally avoid rewriting makefiles to CMake unless it's absolutely necessary (e.g., the makefile has become very hard to maintain). That's because projects using makefile naturally set up the build process around how Make works, and that doesn't translate so well to CMake. I suspect that at least some of the anti CMake hate stems from trying to get CMake to behave exactly like Make. A successful conversion to CMake may require rethinking the build process from the ground up. Before you do, consider if it's worth the effort.
@@KeaSigmaDelta thanks for the reply, but nowaday many big projects use cmake. so for a new project, it would be just better to use cmake instead of makefile? For my opinion, i really dont think makefile is suitable for the big project, espeically the project related to cross-compile
I used to prefer Make too for similar reasons. Having .o and .d files in the source tree is no big deal when you're targeting only one platform. It becomes annoying when you're cross-compiling for multiple platforms. Basically, you have to do a complete make clean when you want to build for a different platform, or it'll try to use .o files compiled for one platform for another. That's when it's preferable to put the .o files in per-platform build directories.
@@KeaSigmaDeltacmake is hiding all of the information provided in the Makefile. One thing that is obvious even from your video is that CMake does a lot under the hood, which means you need to know exactly what every line in your cmake file does and not only that, you have to remember that. Not knowing this, can lead to strange issues that are hard to debug, especially on larger projects. I would agree that on poorly organised projects the Makefiles are even worse :) And I would add that anyone that have worked on automake and autoconf knows these pains well :) With all this said, there is one thing that I really love about make and that is: I can very easy mix build, test, configuration management and deployment in the same format. I love the simplicity of two stage deployments for web apps, when make is used to perform them.
Yes, it does feel more complicated than it needs to be. That's partially because CMake, C & C++ have built up quite a bit of legacy baggage along the way. The easiest way to make it simpler, is to keep your build scripts as simple as possible. If you have to add build options, then make the default what most people will need...
This is very strange because this video makes it look like make is the complicated one. But I have never seen cmake look like that. It is always incredibly overly complicated and also just never works. Ever small to tiny project I have seen using cmake never compiles and has an unreadable cmake. I think what he is showing is like c vs. javascript/python or C++. Where superficially it makes c look like the harder more complicated one, but in reality, it's the exact opposite. This video basically says that cmake has a ton of hidden things or magic that it's doing. And an actual cmake file you come across will have 10x more junk in it with 100x more hidden junk. The simple honest makefile that you thought was more complicated is the simpler and straightforward one. Also, your Makefiles seemed a little strange to me. Maybe you don't have much experience with make?
Make is what I used for decades before I finally figured out CMake. I still have projects that use make. There's definitely a lot of horrible CMake scripts out there, and I think that people massively overcomplicate their scripts. That's partially because there's a lot of old outdated/bad examples out there that people keep on copying and pasting. It's also because people tend to overcomplicate things, anyway, adding all sorts of unnecessary options and complex rules. Making and keeping things simple takes effort (effort, that's totally worth it in the long-term). This video shows that compiling multiple source files together is actually very simple in CMake. I have a followup video for linking to an external dependency, which you can watch here: ruclips.net/video/GJ4O_flGrYw/видео.html
@KeaSigmaDelta if people keep using it wrongly, it shows it's a poor tool. If all the people are doing wrong, it's not the people. And his video massively misrepresents. What is telling? cmake all the g++ build options. Is it just magic hidden defaults?
@KeaSigmaDelta just all my experience has been negative. Kde switched over years ago when I used to have my own distro. KDE even though it compiles with thousands of warnings about poor quality c++ it atleast compiles. But its the only thing using cmake I can remember that compiles. Watch people doing code reviews. It has a cmake it's not compiling. Itch io. It has a cmake not compiling. Github project uses cmake oh well.
Thanks, very helpful. I'm new to this area and have been concentrating on learning CMake, but want to know more about how the (non-meta) build systems work as well. Looking forward to other comparisons.
They always say one needs to see something worse to start to appreciate what they have. Make seems really difficult and cryptic. Can you please make a video and talk about what generator expressions are and if we can use them for both single generator systems and multi-generator systems as well?
I can consider making a video about generator expressions. They can be used for both single and multi-config generators.
I don't particularly like generator expressions, because they're harder to reason about than the basic build script. They don't work with if/else, because the value in the generator only exists at generation time.
@@KeaSigmaDelta I can totally understand that, but it does seem like they work better for environments such as Visual Studio and others that are multi-config and I have no choice but to learn about them. Really frustrating.
@@default2043 Yes, they're unavoidable for multi-config generators with anything that is different on a per-config basis.
A fear comparison would be between cmake and auto tools (not make).
Comparing make with cmake is useful to those who use Make directly (which I suspect is far more than use autotools).
If someone does do a cmake vs autotools comparison, then please share the link here.
You do it in the long complicated way to make cmake looks better
Nope.
cmake looks less complcated than makefile, but as I use amigaos4 to buildmy little amigaos4 stuff I'm used to makefile, but maybe for laarge projects it can be a PITA.
Sadly, AmigaOS 4's CMake port is rather old, so it's not usable for newer CMake scripts.
GNU Make is more complicated, but once you've got a good template, then you can usually get it up and running relatively quickly. I have no trouble using it for large projects, because adding an extra source file to an existing makefile is very easy.
what do you think of meson?
I've heard good things about meson, but haven't had a chance to try it out yet. That will be coming in a future video...
Thanks, this is been really useful :)
would you think its worth it to rewrite makefile project into cmake?
i have a cross-compile project in my comany. it is completely writen in makefile which looks hard to maintain now.
I personally avoid rewriting makefiles to CMake unless it's absolutely necessary (e.g., the makefile has become very hard to maintain). That's because projects using makefile naturally set up the build process around how Make works, and that doesn't translate so well to CMake. I suspect that at least some of the anti CMake hate stems from trying to get CMake to behave exactly like Make.
A successful conversion to CMake may require rethinking the build process from the ground up. Before you do, consider if it's worth the effort.
@@KeaSigmaDelta thanks for the reply, but nowaday many big projects use cmake. so for a new project, it would be just better to use cmake instead of makefile?
For my opinion, i really dont think makefile is suitable for the big project, espeically the project related to cross-compile
@@m.preacher2829 For a new project I'd probably use CMake, especially if it's a multi-platform project.
I prefer Make because I know *exactly* what it is doing. I don't mind putting .o and .d files in the source dir. That's what make clean is for.
I used to prefer Make too for similar reasons.
Having .o and .d files in the source tree is no big deal when you're targeting only one platform. It becomes annoying when you're cross-compiling for multiple platforms. Basically, you have to do a complete make clean when you want to build for a different platform, or it'll try to use .o files compiled for one platform for another. That's when it's preferable to put the .o files in per-platform build directories.
@@KeaSigmaDeltacmake is hiding all of the information provided in the Makefile.
One thing that is obvious even from your video is that CMake does a lot under the hood, which means you need to know exactly what every line in your cmake file does and not only that, you have to remember that.
Not knowing this, can lead to strange issues that are hard to debug, especially on larger projects.
I would agree that on poorly organised projects the Makefiles are even worse :) And I would add that anyone that have worked on automake and autoconf knows these pains well :)
With all this said, there is one thing that I really love about make and that is: I can very easy mix build, test, configuration management and deployment in the same format.
I love the simplicity of two stage deployments for web apps, when make is used to perform them.
cmake is definitely better than make due to simpler config ... but cmake is still very complicated to use ... there must be a better way
Yes, it does feel more complicated than it needs to be. That's partially because CMake, C & C++ have built up quite a bit of legacy baggage along the way.
The easiest way to make it simpler, is to keep your build scripts as simple as possible. If you have to add build options, then make the default what most people will need...
This is very strange because this video makes it look like make is the complicated one. But I have never seen cmake look like that. It is always incredibly overly complicated and also just never works. Ever small to tiny project I have seen using cmake never compiles and has an unreadable cmake. I think what he is showing is like c vs. javascript/python or C++. Where superficially it makes c look like the harder more complicated one, but in reality, it's the exact opposite. This video basically says that cmake has a ton of hidden things or magic that it's doing. And an actual cmake file you come across will have 10x more junk in it with 100x more hidden junk. The simple honest makefile that you thought was more complicated is the simpler and straightforward one. Also, your Makefiles seemed a little strange to me. Maybe you don't have much experience with make?
Make is what I used for decades before I finally figured out CMake. I still have projects that use make.
There's definitely a lot of horrible CMake scripts out there, and I think that people massively overcomplicate their scripts. That's partially because there's a lot of old outdated/bad examples out there that people keep on copying and pasting. It's also because people tend to overcomplicate things, anyway, adding all sorts of unnecessary options and complex rules. Making and keeping things simple takes effort (effort, that's totally worth it in the long-term).
This video shows that compiling multiple source files together is actually very simple in CMake. I have a followup video for linking to an external dependency, which you can watch here: ruclips.net/video/GJ4O_flGrYw/видео.html
@KeaSigmaDelta if people keep using it wrongly, it shows it's a poor tool. If all the people are doing wrong, it's not the people. And his video massively misrepresents. What is telling? cmake all the g++ build options. Is it just magic hidden defaults?
@@ProgrammingRainbow Wow! You must really hate CMake so much.
@KeaSigmaDelta just all my experience has been negative. Kde switched over years ago when I used to have my own distro. KDE even though it compiles with thousands of warnings about poor quality c++ it atleast compiles. But its the only thing using cmake I can remember that compiles. Watch people doing code reviews. It has a cmake it's not compiling. Itch io. It has a cmake not compiling. Github project uses cmake oh well.