Skip to content

Commit

Permalink
added dependency code
Browse files Browse the repository at this point in the history
  • Loading branch information
lsproule committed Oct 24, 2023
1 parent 5c2e414 commit a722611
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 9 deletions.
5 changes: 3 additions & 2 deletions CTestTestfile.cmake
Original file line number Diff line number Diff line change
@@ -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")
12 changes: 6 additions & 6 deletions DartConfiguration.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -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++
Expand All @@ -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
Expand Down Expand Up @@ -64,7 +64,7 @@ UpdateType: git

# Compiler info
Compiler: /usr/bin/c++
CompilerVersion: 13.2.1
CompilerVersion: 13.1.0

# Dynamic analysis (MemCheck)
PurifyCommand:
Expand Down
19 changes: 18 additions & 1 deletion src/Command/CommandInit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "toml.hpp"
#include <cxxopts.hpp>
#include <algorithm>
#include <ranges>
#include <format>
#include <fstream>
#include <iostream>
Expand Down Expand Up @@ -187,8 +188,24 @@ bool init(std::shared_ptr<Context> 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<bool>()) {
defaultTomlCpp(ctx, args);
std::string language = args["language"].as<std::string>();
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);
Expand Down

0 comments on commit a722611

Please sign in to comment.