|
|
|
@ -205,7 +205,7 @@ struct Command {
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
int generate_cmake(const char *path) {
|
|
|
|
|
int generate_cmake(const char *path, bool root) {
|
|
|
|
|
if (fs::exists(fs::path(path) / "cmake.toml")) {
|
|
|
|
|
cmake::CMake cmake(path, false);
|
|
|
|
|
std::stringstream ss;
|
|
|
|
@ -243,6 +243,7 @@ int generate_cmake(const char *path) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// TODO: make this a setting in the toml?
|
|
|
|
|
if(root) {
|
|
|
|
|
comment("Regenerate CMakeLists.txt file when necessary");
|
|
|
|
|
cmd("include")("cmkr.cmake", "OPTIONAL", "RESULT_VARIABLE", "CMKR_INCLUDE_RESULT").endl();
|
|
|
|
|
|
|
|
|
@ -253,6 +254,7 @@ int generate_cmake(const char *path) {
|
|
|
|
|
cmd("cmake_minimum_required")("VERSION", cmake.cmake_version).endl();
|
|
|
|
|
|
|
|
|
|
cmd("set_property")("GLOBAL", "PROPERTY", "USE_FOLDERS", "ON").endl();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// TODO: remove support and replace with global compile-features
|
|
|
|
|
if (!cmake.cppflags.empty()) {
|
|
|
|
@ -540,7 +542,7 @@ int generate_cmake(const char *path) {
|
|
|
|
|
|
|
|
|
|
for (const auto &sub : cmake.subdirs) {
|
|
|
|
|
if (fs::exists(fs::path(sub) / "cmake.toml"))
|
|
|
|
|
generate_cmake(sub.c_str());
|
|
|
|
|
generate_cmake(sub.c_str(), false);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
throw std::runtime_error("No cmake.toml found!");
|
|
|
|
|