Discussion
Search code, repositories, users, issues, pull requests...
duped: FWIW: there is something fundamentally wrong with a meta-meta build system. I don't think you should bother generating or wrapping CMake, you should be replacing it.
lgtx: The installation instructions being a `curl | sh` writing to the user's bashrc does not inspire confidence.
jjgreen: Since that is the main Rust installation method, your post (and this) will be downvoted to fuck.
Bjartr: If you'd just left off "to fuck" you'd end up way less downvoted, if it even happened at all.
spwa4: Just switch to bazel, copy my hermetic build config and just use it ... yes, you can hate me know.
flohofwoe: Cmake is doing a lot of underappreciated work under the hood that would be very hard to replicate in another tool, tons of accumulated workarounds for all the different host operating systems, compiler toolchains and IDEs.Just alone reverse engineering the Xcode and Visual Studio project file formats for each IDE version isn't fun, but this "boring" grunt work is what makes cmake so valuable.The core ideas of cmake are sound, it's only the scripting language sucks.
ori_b: They did say it was inspired by cargo, which is often installed using rustup as such: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
wg0: Yesterday I had to wrestle with CMake.But how this tool figures out where the header files and build instructions for the libraries are that are included? Any expected layout or industry wide consensus?
eliemichel: CMakes piles up various generations of idioms so there are multiple ways of doing it, but personally I’ve learned to steer away from find_package() and other magical functions. Get all your dependencies as subdirectories (whichever way you prefer) and use add_subdirectory(). Use find_package() only in so-called "config" mode where you explicitly instruct cmake where to find the config for large precompiled dependencies only
looneysquash: Nice. I have been thinking of making something similar. Now hopefully I don't have to!Not sure how big your plans are.My thoughts would be to start as a cmake generator but to eventually replace it. Maybe optionally.And to integrate suppoet for existing package managers like vcpkg.At the same time, I'd want to remain modular enough that's it's not all or nothing. I also don't like locking.But right now package management and build system are decoupled completely. And they are not like that in other ecosystems.For example, Cmake can use vcpkg to install a package but then I still have to write more cmake to actually find and use it.
Surac: Uses CMAKE, Sorry not for me. Call me old but i prefere good old make or batch. Maybe it's because i can understand those tools. Debugging CMAKE build problems made me hate it. Also i code for embedded CPU and most of the time CMAKE is just overkill and does not play well the compiler/binutils provided. The Platform independency is just not happening in those environments.
shevy-java: Will take C only 51 years to adopt.
bluGill: For simple projects. Make is easier for simple things I will grant. However when your projects gets complex at all make becomes a real pain and cmake becomes much easier.Cmake has a lot of warts, but they have also put a lot of effort into finding and fixing all those weird special cases. If your project uses CMake odds are high it will build anywhere.
gavinray: The least painful C/C++ build tool I've used is xmakehttps://github.com/xmake-io/xmakeThe reason why I like it (beyond ease-of-use) is that it can spit out CMakeLists.txt and compile_commands.json for IDE/LSP integration and also supports installing Conan/vcpkg libraries or even Git repos. set_project("myapp") set_languages("c++20") add_requires("conan::fmt/11.0.2", {alias = "fmt"}) add_requires("vcpkg::fmt", {alias = "fmt"}) add_requires("git://github.com/fmtlib/fmt v11.0.2", {alias = "fmt"}) target("myapp") set_kind("binary") add_files("src/*.cpp") add_packages("fmt") Then you use it like # Generate compile_commands.json and CMakeLists.txt $ xmake project -k compile_commands $ xmake project -k cmake # Build + run $ xmake && xmake run myapp
psyclobe: > For example, Cmake can use vcpkg to install a package but then I still have to write more cmake to actually find and use it.I have this solved at our company. We have a tool built on top of vcpkg, to manage internal + external dependencies. Our cmake linker logic leverages the port names and so all you really do is declare your manifest file (vcpkg.json) then declare which one of them you will export publicly.Everything after that is automatic including the exported cmake config for your library.
seniorThrowaway: Having to work around a massive C++ software project daily, I wish you luck. We use conan2, and while it can be very challenging to use, I've yet to find something better that can handle incorporating as dependencies ancient projects that still use autoconf or even custom build tooling. It's also very good at detecting and enforcing ABI compatibility, although there are still some gaps. This problem space is incredibly hard and improving it is a prime driver for the creation of many of the languages that came after C/C++
bluGill: Anyone can make a tool that solves a tiny part of the problem. however the reason no such tool has caught on is because of all the weird special cases you need to handle before it can be useful. Even if you limit your support to desktop: OS/X and Windows that problem will be hard, adding various linux flavors is even more difficult, not to mention BSD. The above is the common/mainstream choices, there Haiku is going to be very different, and I've seen dozens of others over the years, some of them have a following in their niche. Then there are people building for embedded - QNX, vxworks, or even no OS just bare metal - each adding weirdness (and implying cross compiling which makes everything harder because your assumptions are always wrong).I'm sorry I have to be a downer, but the fact is if you can use the word "I" your package manager is obviously not powerful enough for the real world.
tosti: Odds are high the distro maintainer will lose hair trying to package it
kjksf: In the age of AI tools like this are pointless. Especially new ones, given existence of make, cmake, premake and a bunch of others.C++ build system, at the core, boils down to calling gcc foo.c -o foo.obj / link foo.obj foo.exe (please forgive if I got they syntax wrong).Sure, you have more .c files, and you pass some flags but that's the core.I've recently started a new C++ program from scratch.What build system did I write?I didn't. I told Claude:"Write a bun typescript script build.ts that compiles the .cpp files with cl and creates foo.exe. Create release and debug builds, trigger release build with -release cmd-line flag".And it did it in minutes and it worked. And I can expand it with similar instructions. I can ask for release build with all the sanitize flags and claude will add it.The particulars don't matter. I could have asked for a makefile, or cmake file or ninja or a script written in python or in ruby or in Go or in rust. I just like using bun for scripting.The point is that in the past I tried to learn cmake and good lord, it's days spent learning something that I'll spent 1 hr using.It just doesn't make sense to learn any of those tools given that claude can give me working any build system in minutes.It makes even less sense to create new build tools. Even if you create the most amazing tool, I would still choose spending a minute asking claude than spending days learning arbitrary syntax of a new tool.
duped: You're missing finding library/include paths, build configuration (`-D` flags for conditional compilation), fetching these from remote repositories, and versioning.
SpaceNoodled: My thoughts exactly. I thought this was going to be some new thing, but it's just yet another reason that I'll stick with Makefiles.
flohofwoe: Do your Makefiles work across Linux, macOS and Windows (without WSL or MingW), GCC, Clang and MSVC, or allow loading the project into an IDE like Xcode or Visual Studio though? That's why meta-build-systems like cmake were created, not to be a better GNU Make.
uecker: There is something fundamentally wrong with Windows or Visual Studio that it requires ugly solutions.
delta_p_delta_x: Windows and Visual Studio solutions are perfectly fine. MSBuild is a declarative build syntax in XML, it's not very different from a makefile.
uecker: XML is already terrible. But the main problem seems to be that they created something similar but incompatible to make.