diff --git a/src/cmkrlib/cmake.cpp b/src/cmkrlib/cmake.cpp index 3042e6f..e1e040b 100644 --- a/src/cmkrlib/cmake.cpp +++ b/src/cmkrlib/cmake.cpp @@ -159,19 +159,6 @@ CMake::CMake(const std::string &path, bool build) { target.type = to_enum(toml::find(t, "type").as_string(), "target type"); get_optional(t, "sources", target.sources); - -#define renamed(from, to) \ - if (t.contains(from)) { \ - throw std::runtime_error(from "has been renamed to " to); \ - } - - renamed("include-dirs", "include-directories"); - renamed("link-libs", "link-libraries"); - renamed("defines", "compile-definitions"); - renamed("features", "compile-features"); - -#undef renamed - get_optional(t, "compile-definitions", target.compile_definitions); get_optional(t, "compile-features", target.compile_features); get_optional(t, "compile-options", target.compile_options); diff --git a/src/cmkrlib/gen.cpp b/src/cmkrlib/gen.cpp index ae708f4..d941e0a 100644 --- a/src/cmkrlib/gen.cpp +++ b/src/cmkrlib/gen.cpp @@ -41,7 +41,6 @@ static std::vector expand_cmake_path(const fs::path &name, const fs std::vector temp; auto extract_suffix = [](const fs::path &base, const fs::path &full) { - // TODO: delet this auto fullpath = full.string(); auto base_len = base.string().length(); auto delet = fullpath.substr(base_len + 1, fullpath.length() - base_len); @@ -321,7 +320,9 @@ int generate_cmake(const char *path, bool root) { auto inject_includes = [&cmd, &endl](const std::vector &includes) { if (!includes.empty()) { for (const auto &file : includes) { - // TODO: warn/error if file doesn't exist? + if (!fs::is_regular_file(file)) { + throw std::runtime_error("Include '" + file + "' does not exist"); + } cmd("include")(file); } endl();