Add supporrt for cmkr-include

toml-checker
Duncan Ogilvie 4 years ago
parent 5c7f6c979e
commit 1af0b5f1cc

@ -55,6 +55,7 @@ CMake::CMake(const std::string &path, bool build) {
if (toml.contains("cmake")) {
const auto &cmake = toml::find(toml, "cmake");
cmake_version = toml::find(cmake, "minimum").as_string();
cmkr_include = toml::find_or(cmake, "cmkr-include", "cmkr.cmake");
cppflags = optional_array(cmake, "cpp-flags");
cflags = optional_array(cmake, "c-flags");
linkflags = optional_array(cmake, "link-flags");

@ -81,6 +81,7 @@ struct Install {
struct CMake {
std::string cmake_version;
std::string cmkr_include;
std::string build_dir = "build";
std::string generator;
std::string config;

@ -323,10 +323,9 @@ int generate_cmake(const char *path, bool root) {
endl();
}
// TODO: make this a setting in the toml?
if (root) {
comment("Regenerate CMakeLists.txt file when necessary");
cmd("include")("cmkr.cmake", "OPTIONAL", "RESULT_VARIABLE", "CMKR_INCLUDE_RESULT").endl();
cmd("include")(cmake.cmkr_include, "OPTIONAL", "RESULT_VARIABLE", "CMKR_INCLUDE_RESULT").endl();
// clang-format off
cmd("if")("CMKR_INCLUDE_RESULT");

Loading…
Cancel
Save