From a7226116a19830c77b1de07969cc47022889feef Mon Sep 17 00:00:00 2001 From: "lucas.sproule" Date: Tue, 24 Oct 2023 14:45:15 -0400 Subject: [PATCH] added dependency code --- CTestTestfile.cmake | 5 +++-- DartConfiguration.tcl | 12 ++++++------ src/Command/CommandInit.cpp | 19 ++++++++++++++++++- 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/CTestTestfile.cmake b/CTestTestfile.cmake index 69c4e42..a79bcd2 100644 --- a/CTestTestfile.cmake +++ b/CTestTestfile.cmake @@ -1,8 +1,9 @@ # CMake generated Testfile for -# Source directory: /home/deastl/repos/cmake-generator -# Build directory: /home/deastl/repos/cmake-generator +# Source directory: /home/lucas/wrk/cmake-generator +# Build directory: /home/lucas/wrk/cmake-generator # # This file includes the relevant testing commands required for # testing this directory and lists subdirectories to be tested as well. +subdirs("_deps/nlohmann_json-build") subdirs("_deps/cxxopts-build") subdirs("_deps/catch2-build") diff --git a/DartConfiguration.tcl b/DartConfiguration.tcl index 04782f5..f467ffa 100644 --- a/DartConfiguration.tcl +++ b/DartConfiguration.tcl @@ -4,14 +4,14 @@ # Configuration directories and files -SourceDirectory: /home/deastl/repos/cmake-generator -BuildDirectory: /home/deastl/repos/cmake-generator +SourceDirectory: /home/lucas/wrk/cmake-generator +BuildDirectory: /home/lucas/wrk/cmake-generator # Where to place the cost data store CostDataFile: # Site is something like machine.domain, i.e. pragmatic.crd -Site: arch-deastl +Site: lucas # Build name is osname-revision-compiler, i.e. Linux-2.4.2-2smp-c++ BuildName: Linux-c++ @@ -27,8 +27,8 @@ SubmitInactivityTimeout: NightlyStartTime: 00:00:00 EDT # Commands for the build/test/submit cycle -ConfigureCommand: "/usr/bin/cmake" "/home/deastl/repos/cmake-generator" -MakeCommand: /usr/bin/cmake --build . --config "${CTEST_CONFIGURATION_TYPE}" +ConfigureCommand: "/usr/local/bin/cmake" "/home/lucas/wrk/cmake-generator" +MakeCommand: /usr/local/bin/cmake --build . --config "${CTEST_CONFIGURATION_TYPE}" DefaultCTestConfigurationType: Release # version control @@ -64,7 +64,7 @@ UpdateType: git # Compiler info Compiler: /usr/bin/c++ -CompilerVersion: 13.2.1 +CompilerVersion: 13.1.0 # Dynamic analysis (MemCheck) PurifyCommand: diff --git a/src/Command/CommandInit.cpp b/src/Command/CommandInit.cpp index 7ae1b0b..8aa283d 100644 --- a/src/Command/CommandInit.cpp +++ b/src/Command/CommandInit.cpp @@ -2,6 +2,7 @@ #include "toml.hpp" #include #include +#include #include #include #include @@ -187,8 +188,24 @@ bool init(std::shared_ptr ctx, cxxopts::ParseResult &args) { std::cout << "project path" << ctx->project_path << ENDL; std::cout << "config.toml path" << ctx->project_path / file_name << ENDL; + std::string current_path = ctx->project_path.string(); + auto const dir { current_path + | std::views::split('\\') + }; + + + if (args["skip-init"].as()) { - defaultTomlCpp(ctx, args); + std::string language = args["language"].as(); + if (language == "cpp" || language == "c++"){ + defaultTomlCpp(ctx, args); + } + else if (language == "c") { + //defaultTomlC(ctx, args); + std::cout << "C is not supported yet" << ENDL; + exit(-1); + } + loadPackageToml(ctx); createCMakelists(ctx); createHelloWorldCpp(ctx);