@@ -219,19 +219,33 @@ CMake::CMake(const std::string &path, bool build) {
219219 }
220220
221221 if (t.contains (" properties" )) {
222- const auto &props = toml::find (t, " properties" ).as_table ();
223- for (const auto &propKv : props) {
224- if (propKv.second .is_array ()) {
222+ auto store_property = [&target](const toml::key &k, const TomlBasicValue &v, const std::string &condition) {
223+ if (v.is_array ()) {
225224 std::string property_list;
226- for (const auto &list_val : propKv. second .as_array ()) {
225+ for (const auto &list_val : v .as_array ()) {
227226 if (!property_list.empty ()) {
228227 property_list += ' ;' ;
229228 }
230229 property_list += list_val.as_string ();
231230 }
232- target.properties [propKv.first ] = property_list;
231+ target.properties [condition][k] = property_list;
232+ } else if (v.is_boolean ()) {
233+ target.properties [condition][k] = v.as_boolean () ? " ON" : " OFF" ;
234+ } else {
235+ target.properties [condition][k] = v.as_string ();
236+ }
237+ };
238+
239+ const auto &props = toml::find (t, " properties" ).as_table ();
240+ for (const auto &propKv : props) {
241+ const auto &k = propKv.first ;
242+ const auto &v = propKv.second ;
243+ if (v.is_table ()) {
244+ for (const auto &condKv : v.as_table ()) {
245+ store_property (condKv.first , condKv.second , k);
246+ }
233247 } else {
234- target. properties [propKv. first ] = propKv. second . as_string ( );
248+ store_property (k, v, " " );
235249 }
236250 }
237251 }
0 commit comments