mirror of
https://github.com/build-cpp/cmkr
synced 2026-06-08 13:22:55 +00:00
refactor generate_project code
This commit is contained in:
+4
-1
@@ -1,5 +1,6 @@
|
||||
#include "build.h"
|
||||
#include "error.h"
|
||||
#include "gen.h"
|
||||
|
||||
#include <filesystem>
|
||||
#include <sstream>
|
||||
@@ -14,8 +15,10 @@ namespace cmkr::build {
|
||||
int run(int argc, char **argv) {
|
||||
std::stringstream ss;
|
||||
std::string bin_dir = "bin";
|
||||
|
||||
if (!std::filesystem::exists("CMakeLists.txt"))
|
||||
throw std::runtime_error("No valid CMakeLists.txt found!");
|
||||
if (gen::generate_cmake("."))
|
||||
throw std::runtime_error("CMake generation failure!");
|
||||
|
||||
const auto toml = toml::parse("cmake.toml");
|
||||
if (toml.contains("cmake")) {
|
||||
|
||||
Reference in New Issue
Block a user