{"by":"randerson_112","descendants":168,"id":47705413,"kids":[47706887,47706326,47706707,47706302,47708601,47706234,47706306,47709039,47706008,47708837,47705850,47708286,47705770,47714039,47706189,47707568,47706163,47706282,47714782,47713894,47706265,47706769,47708709,47708626,47706571,47705645,47717242,47705988,47720701,47706529,47757418,47711874,47711072,47714118,47706078,47714484,47719820,47714924,47715488,47705414,47728144,47732643,47720274,47729015,47712398,47705820,47706343],"score":177,"text":"I love C and C++, but setting up projects can sometimes be a pain.<p>Every time I wanted to start something new I&#x27;d spend the first hour writing CMakeLists.txt, figuring out find_package, copying boilerplate from my last project, and googling why my library isn&#x27;t linking. By the time the project was actually set up I&#x27;d lost all momentum.<p>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:<p><pre><code>  [project]\n  name = &quot;my_app&quot;\n  version = &quot;0.1.0&quot;\n  language = &quot;c&quot;\n  c_standard = 99\n\n  [build]\n  type = &quot;executable&quot;\n</code></pre>\nRun craft build and Craft generates the CMakeLists.txt automatically and builds your project. Want to add dependencies? That&#x27;s just a simple command:<p><pre><code>  craft add --git https:&#x2F;&#x2F;github.com&#x2F;raysan5&#x2F;raylib --links raylib\n  craft add --path ..&#x2F;my_library\n  craft add sfml\n</code></pre>\nCraft will clone the dependency, regenerate the CMake, and rebuild your project for you.<p>Other Craft features: craft init - adopt an existing C&#x2F;C++ project into Craft or initialize an empty directory. \ncraft 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.<p>CMakeLists.extra.cmake for anything that Craft does not yet handle.<p>Cross platform - macOS, Linux, Windows.<p>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.<p>Would love feedback. Please also feel free to make pull requests if you want to help with development!","time":1775750694,"title":"Show HN: I built a Cargo-like build tool for C/C++","type":"story","url":"https://github.com/randerson112/craft"}