|
@ -1,19 +1,15 @@ |
|
|
#include "project.h"
|
|
|
#include "project.h"
|
|
|
#include <iostream>
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
|
Project Project::fromFile(std::string path) { |
|
|
|
|
|
return Project::fromFile(fs::path(path)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Project Project::fromFile(fs::path path) { |
|
|
|
|
|
|
|
|
Project Project::from_file(fs::path path) { |
|
|
auto manifest = cpptoml::parse_file(path); |
|
|
auto manifest = cpptoml::parse_file(path); |
|
|
auto basepath = fs::absolute(path).parent_path(); |
|
|
auto basepath = fs::absolute(path).parent_path(); |
|
|
|
|
|
|
|
|
auto project = Project::fromToml(manifest, basepath); |
|
|
|
|
|
|
|
|
auto project = Project::from_toml(manifest, basepath); |
|
|
return project; |
|
|
return project; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
Project Project::fromToml(std::shared_ptr<cpptoml::table> manifest, |
|
|
|
|
|
|
|
|
Project Project::from_toml(std::shared_ptr<cpptoml::table> manifest, |
|
|
fs::path basepath = fs::path(".")) { |
|
|
fs::path basepath = fs::path(".")) { |
|
|
auto project = Project(); |
|
|
auto project = Project(); |
|
|
project.basepath = basepath; |
|
|
project.basepath = basepath; |
|
|