{
  "id": "cmake",
  "name": "CMake",
  "description": "Cross-platform build system generator.",
  "homepage": "https://cmake.org",
  "executables": [
    "cmake"
  ],
  "commands": {
    "format": 1,
    "label": "Configure a project",
    "description": "Generate a build tree from a source tree. The --build mode and cmake -E tools are left out; cache entries are passed as -D NAME=VALUE.",
    "quality": "ai-draft",
    "base": "fig:cmake",
    "parser": {
      "end_of_options": "--",
      "interleave": "permute",
      "long_equals": true,
      "short_attached": true,
      "short_bundles": false
    },
    "source": [
      {
        "id": "fig",
        "kind": "completion",
        "url": "https://github.com/withfig/autocomplete/blob/master/src/cmake.ts",
        "license": "MIT"
      }
    ],
    "field": [
      {
        "id": "source",
        "label": "Source directory",
        "type": "path",
        "option": [
          "-S"
        ],
        "path": {
          "kind": "directory",
          "role": "input",
          "must_exist": true
        },
        "sources": [
          "fig"
        ]
      },
      {
        "id": "build_dir",
        "label": "Build directory",
        "description": "Created if it does not exist.",
        "type": "path",
        "option": [
          "-B"
        ],
        "path": {
          "kind": "directory",
          "role": "output",
          "must_exist": false
        },
        "sources": [
          "fig"
        ]
      },
      {
        "id": "generator",
        "label": "Generator",
        "type": "string",
        "option": [
          "-G"
        ],
        "suggestions": [
          {
            "value": "Ninja",
            "label": "Ninja"
          },
          {
            "value": "Unix Makefiles",
            "label": "Unix Makefiles"
          },
          {
            "value": "Xcode",
            "label": "Xcode"
          }
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "defines",
        "label": "Cache entries",
        "description": "NAME=VALUE, e.g. CMAKE_BUILD_TYPE=Release.",
        "type": "string",
        "option": [
          "-D"
        ],
        "multiple": true,
        "sources": [
          "fig"
        ]
      },
      {
        "id": "preset",
        "label": "Preset",
        "type": "string",
        "option": [
          "--preset"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "install_prefix",
        "label": "Install prefix",
        "type": "path",
        "option": [
          "--install-prefix"
        ],
        "path": {
          "kind": "directory",
          "role": "output",
          "must_exist": false
        },
        "sources": [
          "fig"
        ]
      },
      {
        "id": "log_level",
        "label": "Log level",
        "type": "enum",
        "option": [
          "--log-level"
        ],
        "choices": [
          {
            "value": "ERROR",
            "label": "Error"
          },
          {
            "value": "WARNING",
            "label": "Warning"
          },
          {
            "value": "NOTICE",
            "label": "Notice"
          },
          {
            "value": "STATUS",
            "label": "Status"
          },
          {
            "value": "VERBOSE",
            "label": "Verbose"
          },
          {
            "value": "DEBUG",
            "label": "Debug"
          },
          {
            "value": "TRACE",
            "label": "Trace"
          }
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "no_dev_warnings",
        "label": "Suppress developer warnings",
        "type": "boolean",
        "option": [
          "-Wno-dev"
        ],
        "sources": [
          "fig"
        ]
      }
    ],
    "task": [
      {
        "id": "configure",
        "label": "Configure",
        "fields": [
          "source",
          "build_dir",
          "generator",
          "defines"
        ],
        "required": [
          "source",
          "build_dir"
        ]
      },
      {
        "id": "release",
        "label": "Configure release build",
        "fields": [
          "source",
          "build_dir",
          "generator",
          "defines"
        ],
        "required": [
          "source",
          "build_dir"
        ],
        "set": {
          "defines": [
            "CMAKE_BUILD_TYPE=Release"
          ]
        }
      }
    ],
    "group": [
      {
        "id": "basic",
        "label": "Basic",
        "fields": [
          "source",
          "build_dir",
          "generator",
          "defines"
        ]
      },
      {
        "id": "advanced",
        "label": "Advanced",
        "fields": [
          "preset",
          "install_prefix",
          "log_level",
          "no_dev_warnings"
        ]
      }
    ]
  }
}
