def METHOD_NAME(self):
    var_opt_list = [
        ("+pthreads", "GRIB_THREADS"),
        ("+openmp", "GRIB_OMP_THREADS"),
        ("+fortran", "FORTRAN"),
        ("+examples", "EXAMPLES"),
        ("+test", "TESTS"),
    ]
    args = [
        "-DENABLE_%s=%s" % (opt, "ON" if var in self.spec else "OFF")
        for var, opt in var_opt_list
    ]
    if "+netcdf" in self.spec:
        args.extend(
            [
                "-DENABLE_NETCDF=ON",
                # Prevent overriding by environment variable
                # HDF5_ROOT.
                "-DHDF5_ROOT=" + self.spec["hdf5"].prefix,
                # Prevent possible overriding by environment variables
                # NETCDF_ROOT, NETCDF_DIR, and NETCDF_PATH.
                "-DNETCDF_PATH=" + self.spec["netcdf-c"].prefix,
            ]
        )
    else:
        args.append("-DENABLE_NETCDF=OFF")
    if self.spec.variants["jp2k"].value == "none":
        args.append("-DENABLE_JPG=OFF")
    else:
        args.append("-DENABLE_JPG=ON")
    if self.spec.variants["jp2k"].value == "openjpeg":
        args.append("-DOPENJPEG_PATH=" + self.spec["openjpeg"].prefix)
    if "+png" in self.spec:
        args.extend(["-DENABLE_PNG=ON", "-DZLIB_ROOT=" + self.spec["zlib-api"].prefix])
    else:
        args.append("-DENABLE_PNG=OFF")
    if "+aec" in self.spec:
        args.extend(
            [
                "-DENABLE_AEC=ON",
                # Prevent overriding by environment variables
                # AEC_DIR and AEC_PATH.
                "-DAEC_DIR=" + self.spec["libaec"].prefix,
            ]
        )
    else:
        args.append("-DENABLE_AEC=OFF")
    return args