The installation instructions being a `curl | sh` writing to the user's bashrc does not inspire confidence.
ori_b 6 minutes ago [-]
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
jjgreen 7 minutes ago [-]
Since that is the main Rust installation method, your post (and this) will be downvoted to fuck.
Bjartr 4 minutes ago [-]
If you'd just left off "to fuck" you'd end up way less downvoted, if it even happened at all.
randerson_112 54 minutes ago [-]
I love C and C++, but setting up projects can sometimes be a pain.
Every time I wanted to start something new I'd spend the first hour writing CMakeLists.txt, figuring out find_package, copying boilerplate from my last project, and googling why my library isn't linking. By the time the project was actually set up I'd lost all momentum.
So, I built Craft - a lightweight build and workflow tool for C and C++.
Instead of writing CMake, your project configuration goes in a simple craft.toml:
[project]
name = "my_app"
version = "0.1.0"
language = "c"
c_standard = 99
[build]
type = "executable"
Run craft build and Craft generates the CMakeLists.txt automatically and builds your project.
Want to add dependencies? That's just a simple command:
One interesting chicken-egg-problem I couldn't solve is how to figure out the C/C++ toolchain that's going to be used without running cmake on a 'dummy project file' first. For some toolchain/IDE combos (most notably Xcode and VStudio) cmake's toolchain detection takes a lot of time unfortunately.
10 minutes ago [-]
spwa4 5 minutes ago [-]
Just switch to bazel, copy my hermetic build config and just use it ... yes, you can hate me know.
wg0 37 minutes ago [-]
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?
integricho 13 minutes ago [-]
I believe it supports only projects having a working cmake setup, no extra magic
flohofwoe 11 minutes ago [-]
I suspect it depends on a specific directory structure, e.g. look at this generated cmake file:
...and for custom requirements a manually created CMakeLists.extras.txt as escape hatch.
Unclear to me how more interesting scenarios like compiler- and platform-specific build options (enable/disable warnings, defines, etc...), cross-compilation via cmake toolchain files (e.g. via Emscripten SDK, WASI SDK or Android SDK/NDK) would be handled. E.g. just trivial things like "when compiling for Emscripten, include these source files, but not those others".
duped 28 minutes ago [-]
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.
flohofwoe 5 minutes ago [-]
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.
SpaceNoodled 8 minutes ago [-]
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 31 seconds ago [-]
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.
mc-serious 24 minutes ago [-]
[dead]
Rendered at 16:59:12 GMT+0000 (Coordinated Universal Time) with Vercel.
Every time I wanted to start something new I'd spend the first hour writing CMakeLists.txt, figuring out find_package, copying boilerplate from my last project, and googling why my library isn't linking. By the time the project was actually set up I'd lost all momentum.
So, I built Craft - a lightweight build and workflow tool for C and C++.
Instead of writing CMake, your project configuration goes in a simple craft.toml:
[project] name = "my_app" version = "0.1.0" language = "c" c_standard = 99
[build] type = "executable"
Run craft build and Craft generates the CMakeLists.txt automatically and builds your project.
Want to add dependencies? That's just a simple command:
craft add --git https://github.com/raysan5/raylib --links raylib craft add --path ../my_library craft add sfml
Craft will clone the dependency, regenerate the CMake, and rebuild your project for you.
Other Craft features:
craft init - adopt an existing C/C++ project into Craft or initialize an empty directory.
craft template - save any project structure as a template to be initialized later.
craft gen - generate header and source files with starter boilerplate code.
craft upgrade - keeps itself up to date.
CMakeLists.extra.cmake for anything that Craft does not yet handle.
Cross platform - macOS, Linux, Windows.
It is still early (I just got it to v1.0.0) but I am excited to be able to share it and keep improving it.
GitHub repo: https://github.com/randerson112/craft
Would love feedback. Please also feel free to make pull requests if you want to help with development!
Here's my feeble attempt using Deno as base (it's extremely opinionated though and mostly for personal use in my hobby projects):
https://github.com/floooh/fibs
One interesting chicken-egg-problem I couldn't solve is how to figure out the C/C++ toolchain that's going to be used without running cmake on a 'dummy project file' first. For some toolchain/IDE combos (most notably Xcode and VStudio) cmake's toolchain detection takes a lot of time unfortunately.
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?
https://github.com/randerson112/craft/blob/main/CMakeLists.t...
...and for custom requirements a manually created CMakeLists.extras.txt as escape hatch.
Unclear to me how more interesting scenarios like compiler- and platform-specific build options (enable/disable warnings, defines, etc...), cross-compilation via cmake toolchain files (e.g. via Emscripten SDK, WASI SDK or Android SDK/NDK) would be handled. E.g. just trivial things like "when compiling for Emscripten, include these source files, but not those others".
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.