r/cpp • u/Niikelion • Feb 28 '24
Building c++ project with... c++?
Yeah, so as a POC I created a tool that works on top of cmake and allows defining project structure with c++ instead of pesky cmake:
#include "CppMake/Project.hpp"
#include "CppMake/Application.hpp"
using namespace std;
int main() {
Project project("test");
project.create<Application>("test").addSources({
"main.cpp"
});
}
Any thoughts?
6
Upvotes
12
u/jaskij Feb 28 '24
The big issue is, for this to make sense, you need something to build the build script. Which, no bueno.
If you're trying to emulate Rust's
build.rs, do note that it only handles the extra tasks Cargo itself doesn't. Typically code generation or compiling C/C++.