Add inject-before and inject-after

This commit is contained in:
Duncan Ogilvie
2021-03-16 17:49:19 +01:00
parent 0e2cddcbe6
commit f4ef95eabc
3 changed files with 16 additions and 0 deletions
+8
View File
@@ -230,6 +230,10 @@ int generate_cmake(const char *path) {
comment("This file was generated automatically by cmkr.").endl();
if (!cmake.inject_before.empty()) {
ss << cmake.inject_before << "\n\n";
}
if (!cmake.include_before.empty()) {
for (const auto &file : cmake.include_before) {
// TODO: warn/error if file doesn't exist?
@@ -292,6 +296,10 @@ int generate_cmake(const char *path) {
cmd("project")(name, "VERSION", "${" + name + "_PROJECT_VERSION}").endl();
}
if (!cmake.inject_after.empty()) {
ss << cmake.inject_after << "\n\n";
}
if (!cmake.include_after.empty()) {
for (const auto &file : cmake.include_after) {
// TODO: warn/error if file doesn't exist?