From b8fbdb2bedd71de5ad1186924aac4af89039c6a0 Mon Sep 17 00:00:00 2001 From: Mohammed Alyousef Date: Tue, 15 Sep 2020 20:49:43 +0300 Subject: [PATCH] create include dir by default --- README.md | 2 +- include/literals.h | 2 +- src/gen.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2ce5983..210cea9 100644 --- a/README.md +++ b/README.md @@ -85,8 +85,8 @@ APP_OTHER_STUFF = { comment = "does other stuff", value = false } # optional name = "app" # required type = "exe" # required (exe || shared || static) sources = ["src/*.cpp"] # required, supports globbing +include-dirs = ["include"] # optional alias = "" # optional -include-dirs = [] # optional features = [] # optional defines = [] # optional link-libs = [] # optional diff --git a/include/literals.h b/include/literals.h index 592e716..8f2f85d 100644 --- a/include/literals.h +++ b/include/literals.h @@ -34,8 +34,8 @@ version = "0.1.0" name = "%s" type = "%s" sources = ["src/*.cpp"] +include-dirs = ["include"] # alias = "" -# include-dirs = [] # features = [] # defines = [] # link-libs = [] diff --git a/src/gen.cpp b/src/gen.cpp index 83dcf85..e691fee 100644 --- a/src/gen.cpp +++ b/src/gen.cpp @@ -43,16 +43,16 @@ std::string format(const char *fmt, Args... args) { int generate_project(const char *str) { fs::create_directory("src"); + fs::create_directory("include"); const auto dir_name = fs::current_path().stem().string(); std::string mainbuf; const auto tomlbuf = detail::format(cmake_toml, dir_name.c_str(), dir_name.c_str(), str); if (!strcmp(str, "exe")) { mainbuf = detail::format(hello_world, "main"); } else if (!strcmp(str, "static") || !strcmp(str, "shared") !strcmp(str, "lib")) { - fs::create_directory("include"); mainbuf = detail::format(hello_world, "test"); } else if (!strcmp(str, "interface")) { - fs::create_directory("include"); + // Nothing special! } else { throw std::runtime_error( "Unknown project type. Types are exe, lib, shared, static, interface!");