diff options
author | Alexis Jeandet <alexis.jeandet@member.fsf.org> | 2020-05-01 18:20:56 +0200 |
---|---|---|
committer | Alexis Jeandet <alexis.jeandet@member.fsf.org> | 2020-06-08 09:55:17 +0000 |
commit | 77d7bb5014a79db539f82d95392d07c6bda9d6a8 (patch) | |
tree | 8249ab051adc2962203355c8ec59abde420106d8 /tests/manual | |
parent | a8f38f8aab5303bb6e0c6575508661b51b7aebc3 (diff) |
Meson build plugin initial support
Most basic project management is implemented:
- Project config/build
- Build options accessible to user
- Lists most build targets
- Meson and Ninja added to kit setup
- Basic project file tree with files known by Meson
- Some basic meson and ninja process output parsing
- Some project templates
Missing features, that will come later:
- Configurable project tree layout
- Locators for Meson
- Build importer
- Access to Machine files for better user fine tuning
- ...
Fixes: QTCREATORBUG-18117
Change-Id: I2811e71562c113fb0fc6b6177bcf0698fa71ef63
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Diffstat (limited to 'tests/manual')
6 files changed, 226 insertions, 0 deletions
diff --git a/tests/manual/meson/mesonsampleproject/main.cpp b/tests/manual/meson/mesonsampleproject/main.cpp new file mode 100644 index 0000000000..6dcfef8e8e --- /dev/null +++ b/tests/manual/meson/mesonsampleproject/main.cpp @@ -0,0 +1,39 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Alexis Jeandet. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ +#include "mesonsampleproject.h" + +#include <QApplication> +#include <QTranslator> + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + QTranslator translator; + translator.load("mesonsampleproject_" + QLocale::system().name()); + a.installTranslator(&translator); + MesonSampleProject w; + w.show(); + return a.exec(); +} diff --git a/tests/manual/meson/mesonsampleproject/meson.build b/tests/manual/meson/mesonsampleproject/meson.build new file mode 100644 index 0000000000..901285a587 --- /dev/null +++ b/tests/manual/meson/mesonsampleproject/meson.build @@ -0,0 +1,19 @@ +project('mesonsampleproject', 'cpp',default_options : ['cpp_std=c++11']) + +# Documentation: https://mesonbuild.com/Qt5-module.html +qt5 = import('qt5') +qt5dep = dependency('qt5', modules : ['Core', 'Widgets']) + +translations = qt5.compile_translations(ts_files : 'mesonsampleproject_fr_FR.ts', build_by_default : true) + +generated_files = qt5.preprocess( + moc_headers : 'mesonsampleproject.h', + ui_files : 'mesonsampleproject.ui', + dependencies: [qt5dep]) + +executable('mesonsampleproject' + , 'main.cpp' + , 'mesonsampleproject.cpp' + , generated_files + , dependencies : [qt5dep] + , install : true) diff --git a/tests/manual/meson/mesonsampleproject/mesonsampleproject.cpp b/tests/manual/meson/mesonsampleproject/mesonsampleproject.cpp new file mode 100644 index 0000000000..9840775622 --- /dev/null +++ b/tests/manual/meson/mesonsampleproject/mesonsampleproject.cpp @@ -0,0 +1,39 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Alexis Jeandet. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ +#include "mesonsampleproject.h" +#include "ui_mesonsampleproject.h" + +MesonSampleProject::MesonSampleProject(QWidget *parent) + : QMainWindow(parent) + , ui(new Ui::MesonSampleProject) +{ + ui->setupUi(this); +} + +MesonSampleProject::~MesonSampleProject() +{ + delete ui; +} + diff --git a/tests/manual/meson/mesonsampleproject/mesonsampleproject.h b/tests/manual/meson/mesonsampleproject/mesonsampleproject.h new file mode 100644 index 0000000000..b02897e0a4 --- /dev/null +++ b/tests/manual/meson/mesonsampleproject/mesonsampleproject.h @@ -0,0 +1,45 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Alexis Jeandet. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ +#ifndef MESONSAMPLEPROJECT_H +#define MESONSAMPLEPROJECT_H + +#include <QMainWindow> + +QT_BEGIN_NAMESPACE +namespace Ui { class MesonSampleProject; } +QT_END_NAMESPACE + +class MesonSampleProject : public QMainWindow +{ + Q_OBJECT + +public: + MesonSampleProject(QWidget *parent = nullptr); + ~MesonSampleProject(); + +private: + Ui::MesonSampleProject *ui; +}; +#endif // MESONSAMPLEPROJECT_H diff --git a/tests/manual/meson/mesonsampleproject/mesonsampleproject.ui b/tests/manual/meson/mesonsampleproject/mesonsampleproject.ui new file mode 100644 index 0000000000..51e51e1248 --- /dev/null +++ b/tests/manual/meson/mesonsampleproject/mesonsampleproject.ui @@ -0,0 +1,67 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>MesonSampleProject</class> + <widget class="QMainWindow" name="MesonSampleProject"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>800</width> + <height>600</height> + </rect> + </property> + <property name="windowTitle"> + <string>MesonSampleProject</string> + </property> + <widget class="QWidget" name="centralwidget"> + <layout class="QGridLayout" name="gridLayout"> + <item row="0" column="0"> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="0" column="1"> + <widget class="QLabel" name="label"> + <property name="text"> + <string>This is a sample meson project</string> + </property> + </widget> + </item> + <item row="0" column="2"> + <spacer name="horizontalSpacer_2"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <widget class="QMenuBar" name="menubar"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>800</width> + <height>29</height> + </rect> + </property> + </widget> + <widget class="QStatusBar" name="statusbar"/> + </widget> + <resources/> + <connections/> +</ui> diff --git a/tests/manual/meson/mesonsampleproject/mesonsampleproject_fr_FR.ts b/tests/manual/meson/mesonsampleproject/mesonsampleproject_fr_FR.ts new file mode 100644 index 0000000000..1b4f705da2 --- /dev/null +++ b/tests/manual/meson/mesonsampleproject/mesonsampleproject_fr_FR.ts @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.1" language="fr_FR"> +<context> + <name>MesonSampleProject</name> + <message> + <location filename="mesonsampleproject.ui" line="14"/> + <source>MesonSampleProject</source> + <translation>Projet de démonstration Meson</translation> + </message> + <message> + <location filename="mesonsampleproject.ui" line="34"/> + <source>This is a sample meson project</source> + <translation>Ceci est un projet de démonstration pour Meson</translation> + </message> +</context> +</TS> |