{
    "version": 1,
    "kind": "project",
    "id": "R.Plain Cpp Application",
    "category": "I.Projects",
    "trDescription": "Creates a simple C++ application using either qmake, CMake, or Qbs to build.",
    "trDisplayName": "Plain C++ Application",
    "trDisplayCategory": "Non-Qt Project",
    "icon": "../../global/consoleapplication.png",
    "enabled": "%{JS: [ %{Plugins} ].indexOf('QmakeProjectManager') >= 0 || [ %{Plugins} ].indexOf('QbsProjectManager') >= 0 || [ %{Plugins} ].indexOf('CMakeProjectManager') >= 0}",

    "options":
    [
        { "key": "ProjectFile", "value": "%{JS: '%{BuildSystem}' === 'qmake' ? '%{ProFile}' : ('%{BuildSystem}' === 'cmake' ? '%{CMakeFile}' : '%{QbsFile}')}" },
        { "key": "ProFile", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectName}', 'pro')}" },
        { "key": "QbsFile", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectName}', 'qbs')}" },
        { "key": "CMakeFile", "value": "%{ProjectDirectory}/CMakeLists.txt" },
        { "key": "CppFileName", "value": "%{JS: 'main.' + Util.preferredSuffix('text/x-c++src')}" },
        { "key": "IsTopLevelProject", "value": "%{JS: !'%{Exists:ProjectExplorer.Profile.Ids}'}" }
    ],

    "pages":
    [
        {
            "trDisplayName": "Project Location",
            "trShortTitle": "Location",
            "typeId": "Project"
        },
        {
            "trDisplayName": "Define Build System",
            "trShortTitle": "Build System",
            "typeId": "Fields",
            "data":
            [
                {
                    "name": "BuildSystem",
                    "trDisplayName": "Build system:",
                    "type": "ComboBox",
                    "data":
                    {
                        "index": 0,
                        "items":
                        [
                            {
                                "trKey": "qmake",
                                "value": "qmake",
                                "condition": "%{JS: [ %{Plugins} ].indexOf('QmakeProjectManager') >= 0}"
                            },
                            {
                                "trKey": "CMake",
                                "value": "cmake",
                                "condition": "%{JS: [ %{Plugins} ].indexOf('CMakeProjectManager') >= 0}"
                            },
                            {
                                "trKey": "Qbs",
                                "value": "qbs",
                                "condition": "%{JS: [ %{Plugins} ].indexOf('QbsProjectManager') >= 0}"
                            }
                        ]
                    }
                }
            ]
        },

        {
            "trDisplayName": "Kit Selection",
            "trShortTitle": "Kits",
            "typeId": "Kits",
            "enabled": "%{IsTopLevelProject}",
            "data": { "projectFilePath": "%{ProjectFile}" }
        },
        {
            "trDisplayName": "Project Management",
            "trShortTitle": "Summary",
            "typeId": "Summary"
        }
    ],
    "generators":
    [
        {
            "typeId": "File",
            "data":
            [
                {
                    "source": "file.pro",
                    "target": "%{ProFile}",
                    "openAsProject": true,
                    "condition": "%{JS: '%{BuildSystem}' === 'qmake'}"
                },
                {
                    "source": "CMakeLists.txt",
                    "openAsProject": true,
                    "condition": "%{JS: '%{BuildSystem}' === 'cmake'}"
                },
                {
                    "source": "file.qbs",
                    "target": "%{QbsFile}",
                    "openAsProject": true,
                    "condition": "%{JS: '%{BuildSystem}' === 'qbs'}"
                },
                {
                    "source": "main.cpp",
                    "target": "%{CppFileName}",
                    "openInEditor": true
                },
                {
                    "source": "../git.ignore",
                    "target": "%{ProjectDirectory}/.gitignore",
                    "condition": "%{JS: ! %{IsSubproject} && '%{VersionControl}' === 'G.Git'}"
                }
            ]
        }
    ]
}
