From 77d7bb5014a79db539f82d95392d07c6bda9d6a8 Mon Sep 17 00:00:00 2001 From: Alexis Jeandet Date: Fri, 1 May 2020 18:20:56 +0200 Subject: 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 --- tests/manual/meson/mesonsampleproject/main.cpp | 39 +++++++++++++ tests/manual/meson/mesonsampleproject/meson.build | 19 ++++++ .../mesonsampleproject/mesonsampleproject.cpp | 39 +++++++++++++ .../meson/mesonsampleproject/mesonsampleproject.h | 45 +++++++++++++++ .../meson/mesonsampleproject/mesonsampleproject.ui | 67 ++++++++++++++++++++++ .../mesonsampleproject/mesonsampleproject_fr_FR.ts | 17 ++++++ 6 files changed, 226 insertions(+) create mode 100644 tests/manual/meson/mesonsampleproject/main.cpp create mode 100644 tests/manual/meson/mesonsampleproject/meson.build create mode 100644 tests/manual/meson/mesonsampleproject/mesonsampleproject.cpp create mode 100644 tests/manual/meson/mesonsampleproject/mesonsampleproject.h create mode 100644 tests/manual/meson/mesonsampleproject/mesonsampleproject.ui create mode 100644 tests/manual/meson/mesonsampleproject/mesonsampleproject_fr_FR.ts (limited to 'tests/manual') 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 +#include + +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 + +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 @@ + + + MesonSampleProject + + + + 0 + 0 + 800 + 600 + + + + MesonSampleProject + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + This is a sample meson project + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + 0 + 0 + 800 + 29 + + + + + + + + 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 @@ + + + + + MesonSampleProject + + + MesonSampleProject + Projet de démonstration Meson + + + + This is a sample meson project + Ceci est un projet de démonstration pour Meson + + + -- cgit v1.2.3