mirror of
https://github.com/build-cpp/cmkr
synced 2026-06-08 13:22:55 +00:00
Add inject-before and inject-after
This commit is contained in:
@@ -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?
|
||||
|
||||
Reference in New Issue
Block a user