@@ -36,6 +36,10 @@ CMake::CMake(const std::string &path, bool build) {
3636 generator = toml::find (cmake, " generator" ).as_string ();
3737 }
3838
39+ if (cmake.contains (" config" )) {
40+ config = toml::find (cmake, " config" ).as_string ();
41+ }
42+
3943 if (cmake.contains (" arguments" )) {
4044 gen_args = detail::to_string_vec (toml::find (cmake, " arguments" ).as_array ());
4145 }
@@ -68,6 +72,41 @@ CMake::CMake(const std::string &path, bool build) {
6872 proj_version = toml::find (project, " version" ).as_string ();
6973 }
7074
75+ if (toml.contains (" settings" )) {
76+ using set_map =
77+ std::map<std::string, toml::basic_value<toml::discard_comments, std::unordered_map,
78+ std::vector>>;
79+ const auto &sets = toml::find<set_map>(toml, " settings" );
80+ for (const auto set : sets) {
81+ Setting s;
82+ s.name = set.first ;
83+ if (set.second .is_boolean ()) {
84+ s.val = set.second .as_boolean ();
85+ } else if (set.second .is_string ()) {
86+ s.val = set.second .as_string ();
87+ } else {
88+ if (set.second .contains (" comment" )) {
89+ s.comment = toml::find (set.second , " comment" ).as_string ();
90+ }
91+ if (set.second .contains (" value" )) {
92+ auto v = toml::find (set.second , " value" );
93+ if (v.is_boolean ()) {
94+ s.val = v.as_boolean ();
95+ } else {
96+ s.val = v.as_string ();
97+ }
98+ }
99+ if (set.second .contains (" cache" )) {
100+ s.cache = toml::find (set.second , " cache" ).as_boolean ();
101+ }
102+ if (set.second .contains (" force" )) {
103+ s.force = toml::find (set.second , " force" ).as_boolean ();
104+ }
105+ }
106+ settings.push_back (s);
107+ }
108+ }
109+
71110 if (toml.contains (" options" )) {
72111 using opts_map =
73112 std::map<std::string, toml::basic_value<toml::discard_comments, std::unordered_map,
@@ -152,6 +191,11 @@ CMake::CMake(const std::string &path, bool build) {
152191 b.alias = toml::find (bin, " alias" ).as_string ();
153192 }
154193
194+ if (bin.contains (" properties" )) {
195+ using prop_map = std::map<std::string, std::string>;
196+ b.properties = toml::find<prop_map>(bin, " properties" );
197+ }
198+
155199 binaries.push_back (b);
156200 }
157201 }
0 commit comments