Rename inject-after/before to cmake-after/before

vcpkg-wip
Duncan Ogilvie 4 years ago
parent 6000629f9a
commit 028e202e61

@ -4,7 +4,7 @@ minimum = "2.8...3.8"
[project] [project]
name = "cmkr" name = "cmkr"
version = "0.1.3" version = "0.1.3"
inject-after = "add_subdirectory(third_party)" cmake-after = "add_subdirectory(third_party)"
[target.cmkrlib] [target.cmkrlib]
type = "static" type = "static"

@ -70,11 +70,11 @@ CMake::CMake(const std::string &path, bool build) {
const auto &project = toml::find(toml, "project"); const auto &project = toml::find(toml, "project");
project_name = toml::find(project, "name").as_string(); project_name = toml::find(project, "name").as_string();
project_version = toml::find(project, "version").as_string(); project_version = toml::find(project, "version").as_string();
if (project.contains("inject-before")) { if (project.contains("cmake-before")) {
inject_before = toml::find(project, "inject-before").as_string(); cmake_before = toml::find(project, "cmake-before").as_string();
} }
if (project.contains("inject-after")) { if (project.contains("cmake-after")) {
inject_after = toml::find(project, "inject-after").as_string(); cmake_after = toml::find(project, "cmake-after").as_string();
} }
if (project.contains("include-before")) { if (project.contains("include-before")) {
include_before = detail::to_string_vec(toml::find(project, "include-before").as_array()); 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<prop_map>(t, "properties"); target.properties = toml::find<prop_map>(t, "properties");
} }
if (t.contains("inject-before")) { if (t.contains("cmake-before")) {
target.inject_before = toml::find(t, "inject-before").as_string(); target.cmake_before = toml::find(t, "cmake-before").as_string();
} }
if (t.contains("inject-after")) { if (t.contains("cmake-after")) {
target.inject_after = toml::find(t, "inject-after").as_string(); target.cmake_after = toml::find(t, "cmake-after").as_string();
} }
if (t.contains("include-before")) { if (t.contains("include-before")) {
target.include_before = detail::to_string_vec(toml::find(t, "include-before").as_array()); target.include_before = detail::to_string_vec(toml::find(t, "include-before").as_array());

@ -49,8 +49,8 @@ struct Target {
std::string alias; std::string alias;
tsl::ordered_map<std::string, std::string> properties; tsl::ordered_map<std::string, std::string> properties;
std::string inject_before; std::string cmake_before;
std::string inject_after; std::string cmake_after;
std::vector<std::string> include_before; std::vector<std::string> include_before;
std::vector<std::string> include_after; std::vector<std::string> include_after;
}; };
@ -82,8 +82,8 @@ struct CMake {
std::vector<std::string> build_args; std::vector<std::string> build_args;
std::string project_name; std::string project_name;
std::string project_version; std::string project_version;
std::string inject_before; std::string cmake_before;
std::string inject_after; std::string cmake_after;
std::vector<std::string> include_before; std::vector<std::string> include_before;
std::vector<std::string> include_after; std::vector<std::string> include_after;
std::vector<Setting> settings; std::vector<Setting> settings;

@ -261,8 +261,8 @@ int generate_cmake(const char *path, bool root) {
comment("This file was generated automatically by cmkr.").endl(); comment("This file was generated automatically by cmkr.").endl();
if (!cmake.inject_before.empty()) { if (!cmake.cmake_before.empty()) {
ss << tolf(cmake.inject_before) << "\n\n"; ss << tolf(cmake.cmake_before) << "\n\n";
} }
if (!cmake.include_before.empty()) { 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(); cmd("project")(name, "VERSION", "${" + name + "_PROJECT_VERSION}").endl();
} }
if (!cmake.inject_after.empty()) { if (!cmake.cmake_after.empty()) {
ss << tolf(cmake.inject_after) << "\n\n"; ss << tolf(cmake.cmake_after) << "\n\n";
} }
if (!cmake.include_after.empty()) { if (!cmake.include_after.empty()) {
@ -459,8 +459,8 @@ int generate_cmake(const char *path, bool root) {
cmd("set")(target.name + "_SOURCES", sources).endl(); cmd("set")(target.name + "_SOURCES", sources).endl();
} }
if (!target.inject_before.empty()) { if (!target.cmake_before.empty()) {
ss << tolf(target.inject_before) << "\n\n"; ss << tolf(target.cmake_before) << "\n\n";
} }
if (!target.include_before.empty()) { 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(); cmd("set_target_properties")(target.name, "PROPERTIES", target.properties).endl();
} }
if (!target.inject_after.empty()) { if (!target.cmake_after.empty()) {
ss << tolf(target.inject_after) << "\n\n"; ss << tolf(target.cmake_after) << "\n\n";
} }
if (!target.include_after.empty()) { if (!target.include_after.empty()) {

Loading…
Cancel
Save