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]
name = "cmkr"
version = "0.1.3"
inject-after = "add_subdirectory(third_party)"
cmake-after = "add_subdirectory(third_party)"
[target.cmkrlib]
type = "static"

@ -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<prop_map>(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());

@ -49,8 +49,8 @@ struct Target {
std::string alias;
tsl::ordered_map<std::string, std::string> properties;
std::string inject_before;
std::string inject_after;
std::string cmake_before;
std::string cmake_after;
std::vector<std::string> include_before;
std::vector<std::string> include_after;
};
@ -82,8 +82,8 @@ struct CMake {
std::vector<std::string> 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<std::string> include_before;
std::vector<std::string> include_after;
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();
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()) {

Loading…
Cancel
Save