function value = getBuildConfigurationOption(h,name,option,action)
%

%   Copyright 2014-2018 The MathWorks, Inc.

narginchk( 3, 4 );
name = convertStringsToChars(name);
option = convertStringsToChars(option);

% Check
h.checkBuildConfigFor( name );
% g951761: Backward compatibility
option = h.updateIfUsingAlias( option );
% Get the option object
cfg = h.BuildConfigurations.getValue( name );
obj = cfg.getOption( option );
% Get the desired output
if nargin==3
    value = obj.getValue();
elseif nargin==4
    action = convertStringsToChars(action);
    switch lower( action )
        case { 'obj', 'object' }
            value = obj;
        case 'macro'
            value = obj.getMacro();
        case 'value'
            value = obj.getValue();
    end
end
end
