diff --git a/share/qtcreator/templates/wizards/plaincapp/cmake/wizard.xml b/share/qtcreator/templates/wizards/plaincapp/cmake/wizard.xml deleted file mode 100644 index 4bc6964698d..00000000000 --- a/share/qtcreator/templates/wizards/plaincapp/cmake/wizard.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - ../common/console.png - Creates a plain C project using CMake, not using the Qt library. - Plain C Project (CMake Build); - Non-Qt Project - - - - - diff --git a/share/qtcreator/templates/wizards/plaincapp/common/console.png b/share/qtcreator/templates/wizards/plaincapp/common/console.png deleted file mode 100644 index 7569a988f4a..00000000000 Binary files a/share/qtcreator/templates/wizards/plaincapp/common/console.png and /dev/null differ diff --git a/share/qtcreator/templates/wizards/plaincapp/qbs/wizard.xml b/share/qtcreator/templates/wizards/plaincapp/qbs/wizard.xml deleted file mode 100644 index bc6ef59d23f..00000000000 --- a/share/qtcreator/templates/wizards/plaincapp/qbs/wizard.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - ../common/console.png - Creates a plain C project using Qbs. - Plain C Project (Qbs Build); - Non-Qt Project - - - - - diff --git a/share/qtcreator/templates/wizards/plaincapp/qmake/wizard.xml b/share/qtcreator/templates/wizards/plaincapp/qmake/wizard.xml deleted file mode 100644 index 29447980df9..00000000000 --- a/share/qtcreator/templates/wizards/plaincapp/qmake/wizard.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - ../common/console.png - Creates a plain C project using qmake, not using the Qt library. - Plain C Project; - Non-Qt Project - - - - - diff --git a/share/qtcreator/templates/wizards/plaincapp/cmake/CMakeLists.txt b/share/qtcreator/templates/wizards/projects/plainc/CMakeLists.txt similarity index 82% rename from share/qtcreator/templates/wizards/plaincapp/cmake/CMakeLists.txt rename to share/qtcreator/templates/wizards/projects/plainc/CMakeLists.txt index aad92e30c3c..9001db70166 100644 --- a/share/qtcreator/templates/wizards/plaincapp/cmake/CMakeLists.txt +++ b/share/qtcreator/templates/wizards/projects/plainc/CMakeLists.txt @@ -1,4 +1,4 @@ -project(%ProjectName%) +project(%{ProjectName}) cmake_minimum_required(VERSION 2.8) aux_source_directory(. SRC_LIST) add_executable(${PROJECT_NAME} ${SRC_LIST}) diff --git a/share/qtcreator/templates/wizards/plaincapp/qmake/project.pro b/share/qtcreator/templates/wizards/projects/plainc/file.pro similarity index 75% rename from share/qtcreator/templates/wizards/plaincapp/qmake/project.pro rename to share/qtcreator/templates/wizards/projects/plainc/file.pro index 7e6c04258a8..75b02a7d37b 100644 --- a/share/qtcreator/templates/wizards/plaincapp/qmake/project.pro +++ b/share/qtcreator/templates/wizards/projects/plainc/file.pro @@ -3,4 +3,4 @@ CONFIG += console c++11 CONFIG -= app_bundle CONFIG -= qt -SOURCES += main.c +SOURCES += %{CFileName} diff --git a/share/qtcreator/templates/wizards/plaincapp/qbs/project.qbs b/share/qtcreator/templates/wizards/projects/plainc/file.qbs similarity index 90% rename from share/qtcreator/templates/wizards/plaincapp/qbs/project.qbs rename to share/qtcreator/templates/wizards/projects/plainc/file.qbs index 2e30fb31c68..3f178d05c0e 100644 --- a/share/qtcreator/templates/wizards/plaincapp/qbs/project.qbs +++ b/share/qtcreator/templates/wizards/projects/plainc/file.qbs @@ -3,7 +3,7 @@ import qbs CppApplication { type: "application" // To suppress bundle generation on Mac consoleApplication: true - files: "main.c" + files: "%{CFileName}" Group { // Properties for the produced executable fileTagsFilter: product.type diff --git a/share/qtcreator/templates/wizards/plaincapp/common/main.c b/share/qtcreator/templates/wizards/projects/plainc/main.c similarity index 63% rename from share/qtcreator/templates/wizards/plaincapp/common/main.c rename to share/qtcreator/templates/wizards/projects/plainc/main.c index 8f1edd610c6..8192ca7faf0 100644 --- a/share/qtcreator/templates/wizards/plaincapp/common/main.c +++ b/share/qtcreator/templates/wizards/projects/plainc/main.c @@ -2,6 +2,6 @@ int main(void) { - printf("Hello World!\n"); + printf("Hello World!\\n"); return 0; } diff --git a/share/qtcreator/templates/wizards/projects/plainc/wizard.json b/share/qtcreator/templates/wizards/projects/plainc/wizard.json new file mode 100644 index 00000000000..5e1828351a5 --- /dev/null +++ b/share/qtcreator/templates/wizards/projects/plainc/wizard.json @@ -0,0 +1,115 @@ +{ + "version": 1, + "kind": "project", + "id": "A.Plain C 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": "CFileName", "value": "%{JS: 'main.' + Util.preferredSuffix('text/x-csrc')}" }, + { "key": "IsTopLevelProject", "value": "%{JS: !'%{Exists:ProjectExplorer.Profile.Ids}'}" } + ], + + "pages": + [ + { + "trDisplayName": "Project Location", + "trShortTitle": "Location", + "typeId": "Project", + "data": { "trDescription": "This wizard creates an empty .pro file." } + }, + { + "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.c", + "target": "%{CFileName}", + "openInEditor": true + }, + { + "source": "../git.ignore", + "target": "%{ProjectDirectory}/.gitignore", + "condition": "%{JS: ! %{IsSubproject} && '%{VersionControl}' === 'G.Git'}" + } + ] + } + ] +}