|
|
@ -390,7 +390,9 @@ struct Generator {
|
|
|
|
cmd("if")(RawArg(cmake.conditions[condition]));
|
|
|
|
cmd("if")(RawArg(cmake.conditions[condition]));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fn(condition, itr.second);
|
|
|
|
if (!itr.second.empty()) {
|
|
|
|
|
|
|
|
fn(condition, itr.second);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!condition.empty()) {
|
|
|
|
if (!condition.empty()) {
|
|
|
|
cmd("endif")();
|
|
|
|
cmd("endif")();
|
|
|
@ -573,19 +575,22 @@ int generate_cmake(const char *path, bool root) {
|
|
|
|
|
|
|
|
|
|
|
|
// generate_cmake is called on the subdirectories recursively later
|
|
|
|
// generate_cmake is called on the subdirectories recursively later
|
|
|
|
if (!cmake.subdirs.empty()) {
|
|
|
|
if (!cmake.subdirs.empty()) {
|
|
|
|
for (const auto &dir : cmake.subdirs) {
|
|
|
|
gen.handle_condition(cmake.subdirs, [&](const std::string &, const std::vector<std::string> &subdirs) {
|
|
|
|
// clang-format off
|
|
|
|
for (const auto &dir : subdirs) {
|
|
|
|
comment(dir);
|
|
|
|
// clang-format off
|
|
|
|
cmd("set")("CMKR_CMAKE_FOLDER", "${CMAKE_FOLDER}");
|
|
|
|
comment(dir);
|
|
|
|
cmd("if")("CMAKE_FOLDER");
|
|
|
|
cmd("set")("CMKR_CMAKE_FOLDER", "${CMAKE_FOLDER}");
|
|
|
|
cmd("set")("CMAKE_FOLDER", "${CMAKE_FOLDER}/" + dir);
|
|
|
|
cmd("if")("CMAKE_FOLDER");
|
|
|
|
cmd("else")();
|
|
|
|
cmd("set")("CMAKE_FOLDER", "${CMAKE_FOLDER}/" + dir);
|
|
|
|
cmd("set")("CMAKE_FOLDER", dir);
|
|
|
|
cmd("else")();
|
|
|
|
cmd("endif")();
|
|
|
|
cmd("set")("CMAKE_FOLDER", dir);
|
|
|
|
// clang-format on
|
|
|
|
cmd("endif")();
|
|
|
|
cmd("add_subdirectory")(dir);
|
|
|
|
// clang-format on
|
|
|
|
cmd("set")("CMAKE_FOLDER", "${CMKR_CMAKE_FOLDER}").endl();
|
|
|
|
|
|
|
|
}
|
|
|
|
cmd("add_subdirectory")(dir);
|
|
|
|
|
|
|
|
cmd("set")("CMAKE_FOLDER", "${CMKR_CMAKE_FOLDER}").endl();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
endl();
|
|
|
|
endl();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -755,10 +760,12 @@ int generate_cmake(const char *path, bool root) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for (const auto &sub : cmake.subdirs) {
|
|
|
|
for (const auto &itr : cmake.subdirs) {
|
|
|
|
auto subpath = fs::path(path) / fs::path(sub);
|
|
|
|
for (const auto &sub : itr.second) {
|
|
|
|
if (fs::exists(subpath / "cmake.toml"))
|
|
|
|
auto subpath = fs::path(path) / fs::path(sub);
|
|
|
|
generate_cmake(subpath.string().c_str(), false);
|
|
|
|
if (fs::exists(subpath / "cmake.toml"))
|
|
|
|
|
|
|
|
generate_cmake(subpath.string().c_str(), false);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|