#pragma once #include #include #include #include #include #include namespace cmkr { namespace cmake { struct Setting { std::string name; std::string comment; mpark::variant val; bool cache = false; bool force = false; }; struct Option { std::string name; std::string comment; bool val = false; }; struct Package { std::string name; std::string version; bool required = true; bool config = true; std::vector components; }; struct Vcpkg { std::string version; std::vector packages; }; enum TargetType { target_executable, target_library, target_shared, target_static, target_interface, target_custom, }; template using Condition = tsl::ordered_map; using ConditionVector = Condition>; struct Target { std::string name; TargetType type = {}; // https://cmake.org/cmake/help/latest/manual/cmake-commands.7.html#project-commands ConditionVector compile_definitions; ConditionVector compile_features; ConditionVector compile_options; ConditionVector include_directories; ConditionVector link_directories; ConditionVector link_libraries; ConditionVector link_options; ConditionVector precompile_headers; ConditionVector sources; std::string alias; tsl::ordered_map properties; Condition cmake_before; Condition cmake_after; ConditionVector include_before; ConditionVector include_after; }; struct Test { std::string name; std::vector configurations; std::string working_directory; std::string command; std::vector arguments; }; struct Install { std::vector targets; std::vector files; std::vector dirs; std::vector configs; std::string destination; }; struct CMake { // This is the CMake version required to use all cmkr versions. std::string cmake_version = "3.15"; std::string cmkr_include = "cmkr.cmake"; std::string build_dir = "build"; std::string generator; std::string config; std::vector subdirs; std::vector cppflags; std::vector cflags; std::vector linkflags; std::vector gen_args; std::vector build_args; std::string project_name; std::string project_version; std::string project_description; std::vector project_languages; Condition cmake_before; Condition cmake_after; ConditionVector include_before; ConditionVector include_after; std::vector settings; std::vector