From 028e202e616f7242121a429507382ad455fbe2b5 Mon Sep 17 00:00:00 2001 From: Duncan Ogilvie Date: Wed, 31 Mar 2021 13:52:46 +0200 Subject: [PATCH] Rename inject-after/before to cmake-after/before --- cmake.toml | 2 +- src/cmkrlib/cmake.cpp | 16 ++++++++-------- src/cmkrlib/cmake.hpp | 8 ++++---- src/cmkrlib/gen.cpp | 16 ++++++++-------- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/cmake.toml b/cmake.toml index 71c7dde..080f0f2 100644 --- a/cmake.toml +++ b/cmake.toml @@ -4,7 +4,7 @@ minimum = "2.8...3.8" [project] name = "cmkr" version = "0.1.3" -inject-after = "add_subdirectory(third_party)" +cmake-after = "add_subdirectory(third_party)" [target.cmkrlib] type = "static" diff --git a/src/cmkrlib/cmake.cpp b/src/cmkrlib/cmake.cpp index 4b3ecfd..c9395ca 100644 --- a/src/cmkrlib/cmake.cpp +++ b/src/cmkrlib/cmake.cpp @@ -70,11 +70,11 @@ CMake::CMake(const std::string &path, bool build) { const auto &project = toml::find(toml, "project"); project_name = toml::find(project, "name").as_string(); project_version = toml::find(project, "version").as_string(); - if (project.contains("inject-before")) { - inject_before = toml::find(project, "inject-before").as_string(); + if (project.contains("cmake-before")) { + cmake_before = toml::find(project, "cmake-before").as_string(); } - if (project.contains("inject-after")) { - inject_after = toml::find(project, "inject-after").as_string(); + if (project.contains("cmake-after")) { + cmake_after = toml::find(project, "cmake-after").as_string(); } if (project.contains("include-before")) { include_before = detail::to_string_vec(toml::find(project, "include-before").as_array()); @@ -222,11 +222,11 @@ CMake::CMake(const std::string &path, bool build) { target.properties = toml::find(t, "properties"); } - if (t.contains("inject-before")) { - target.inject_before = toml::find(t, "inject-before").as_string(); + if (t.contains("cmake-before")) { + target.cmake_before = toml::find(t, "cmake-before").as_string(); } - if (t.contains("inject-after")) { - target.inject_after = toml::find(t, "inject-after").as_string(); + if (t.contains("cmake-after")) { + target.cmake_after = toml::find(t, "cmake-after").as_string(); } if (t.contains("include-before")) { target.include_before = detail::to_string_vec(toml::find(t, "include-before").as_array()); diff --git a/src/cmkrlib/cmake.hpp b/src/cmkrlib/cmake.hpp index ceef2a6..13db5ec 100644 --- a/src/cmkrlib/cmake.hpp +++ b/src/cmkrlib/cmake.hpp @@ -49,8 +49,8 @@ struct Target { std::string alias; tsl::ordered_map properties; - std::string inject_before; - std::string inject_after; + std::string cmake_before; + std::string cmake_after; std::vector include_before; std::vector include_after; }; @@ -82,8 +82,8 @@ struct CMake { std::vector build_args; std::string project_name; std::string project_version; - std::string inject_before; - std::string inject_after; + std::string cmake_before; + std::string cmake_after; std::vector include_before; std::vector include_after; std::vector settings; diff --git a/src/cmkrlib/gen.cpp b/src/cmkrlib/gen.cpp index 578b5e2..e624af8 100644 --- a/src/cmkrlib/gen.cpp +++ b/src/cmkrlib/gen.cpp @@ -261,8 +261,8 @@ int generate_cmake(const char *path, bool root) { comment("This file was generated automatically by cmkr.").endl(); - if (!cmake.inject_before.empty()) { - ss << tolf(cmake.inject_before) << "\n\n"; + if (!cmake.cmake_before.empty()) { + ss << tolf(cmake.cmake_before) << "\n\n"; } if (!cmake.include_before.empty()) { @@ -321,8 +321,8 @@ int generate_cmake(const char *path, bool root) { cmd("project")(name, "VERSION", "${" + name + "_PROJECT_VERSION}").endl(); } - if (!cmake.inject_after.empty()) { - ss << tolf(cmake.inject_after) << "\n\n"; + if (!cmake.cmake_after.empty()) { + ss << tolf(cmake.cmake_after) << "\n\n"; } if (!cmake.include_after.empty()) { @@ -459,8 +459,8 @@ int generate_cmake(const char *path, bool root) { cmd("set")(target.name + "_SOURCES", sources).endl(); } - if (!target.inject_before.empty()) { - ss << tolf(target.inject_before) << "\n\n"; + if (!target.cmake_before.empty()) { + ss << tolf(target.cmake_before) << "\n\n"; } if (!target.include_before.empty()) { @@ -499,8 +499,8 @@ int generate_cmake(const char *path, bool root) { cmd("set_target_properties")(target.name, "PROPERTIES", target.properties).endl(); } - if (!target.inject_after.empty()) { - ss << tolf(target.inject_after) << "\n\n"; + if (!target.cmake_after.empty()) { + ss << tolf(target.cmake_after) << "\n\n"; } if (!target.include_after.empty()) {