function initializeBuildConfigOption(h,optionName,optionMacro,optionValue)
%

%   Copyright 2014 The MathWorks, Inc.

cfgs = h.getBuildConfigurationNames();
for i = 1:numel( cfgs )
    % Create a BuildItem object (create a new object every time
    % inside this loop, or else the same handle will be used in
    % all build configurations)
    optionObj = h.createBuildItem( optionMacro, optionValue );
    % Add the BuildItem object to each build config
    cfgName = cfgs{ i };
    cfg = h.BuildConfigurations.getValue( cfgName );  % get config
    cfg.addOption( optionName, optionObj );  % update
    h.BuildConfigurations.setValue( cfgName, cfg );  % re-save back
end
end
