aboutsummaryrefslogtreecommitdiff
path: root/src/about
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2020-12-07 12:22:15 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2020-12-07 12:22:15 +0200
commit92b3c2dcff3e85ad3d455f6ab845d9a97d3b525b (patch)
treea850643f7b86e6cebfddbeec98d7c372478d379c /src/about
parentHostlist filter plugin can rewrite hostnames (diff)
downloadsmolbote-92b3c2dcff3e85ad3d455f6ab845d9a97d3b525b.tar.xz
Rewrite meson build scripts into cmakelists
Diffstat (limited to 'src/about')
-rw-r--r--src/about/CMakeLists.txt11
-rw-r--r--src/about/aboutdialog.cpp6
-rw-r--r--src/about/meson.build21
-rw-r--r--src/about/test/main.cpp8
4 files changed, 18 insertions, 28 deletions
diff --git a/src/about/CMakeLists.txt b/src/about/CMakeLists.txt
new file mode 100644
index 0000000..027d509
--- /dev/null
+++ b/src/about/CMakeLists.txt
@@ -0,0 +1,11 @@
+add_library(about_dialog INTERFACE)
+target_sources(about_dialog INTERFACE aboutdialog.h aboutdialog.cpp aboutdialog.ui)
+target_include_directories(about_dialog INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
+target_link_libraries(about_dialog INTERFACE autogen Qt5::Widgets Qt5::Svg)
+
+add_library(about_plugin INTERFACE)
+target_sources(about_plugin INTERFACE aboutplugin.h aboutplugin.cpp aboutplugin.ui)
+
+add_executable(test_about test/main.cpp)
+target_link_libraries(test_about PRIVATE about_dialog Catch2::Catch2)
+target_sanitize(test_about) \ No newline at end of file
diff --git a/src/about/aboutdialog.cpp b/src/about/aboutdialog.cpp
index 6fa4127..643b87c 100644
--- a/src/about/aboutdialog.cpp
+++ b/src/about/aboutdialog.cpp
@@ -7,9 +7,9 @@
*/
#include "aboutdialog.h"
-#include "../poi_logos.h"
+#include "poi_logos.h"
#include "ui_aboutdialog.h"
-#include <version.h>
+#include "version.h"
// compiler
// clang also defines __GNUC__, so we need to check for clang first
@@ -55,7 +55,7 @@ AboutDialog::AboutDialog(QWidget *parent)
"<p>This program is distributed in the hope that it will be useful, but without any warranty.</p>"
"<p>You can read the full terms of the license on <a href='https://www.gnu.org/licenses/gpl-3.0.en.html'>the GNU website</a>.</p>"));
- ui->detailsLabel->setText(tr("<p>Version " poi_Version "</p>"
+ ui->detailsLabel->setText(tr("<p>Version " POI_VERSION "</p>"
"<p>Compiled with " compiler "</p>"
"<p>Libraries: <ul>"
"<li><a href='https://www.qt.io/'>Qt5</a> " QT_VERSION_STR "</li>"
diff --git a/src/about/meson.build b/src/about/meson.build
deleted file mode 100644
index 49274a8..0000000
--- a/src/about/meson.build
+++ /dev/null
@@ -1,21 +0,0 @@
-about_moc = mod_qt5.preprocess(
- moc_headers: ['aboutdialog.h', 'aboutplugin.h'],
- ui_files: ['aboutdialog.ui', 'aboutplugin.ui'],
- dependencies: dep_qt5
-)
-
-dep_about = declare_dependency(
- include_directories: '.',
- link_with: static_library('about',
- [ 'aboutdialog.cpp', 'aboutplugin.cpp', about_moc, version_h],
- dependencies: [dep_qt5])
-)
-
-poi_sourceset.add(dep_about)
-
-test('about dialog', executable('about',
- sources: 'test/main.cpp',
- dependencies: [ dep_qt5, dep_about, dep_catch ]),
- args: [ '-platform', 'offscreen' ],
- env: 'autoclose=1'
-)
diff --git a/src/about/test/main.cpp b/src/about/test/main.cpp
index 18037e1..1b71c8e 100644
--- a/src/about/test/main.cpp
+++ b/src/about/test/main.cpp
@@ -1,12 +1,13 @@
#include <QApplication>
#include <QTimer>
#include "aboutdialog.h"
+#include "version.h"
int main(int argc, char **argv)
{
QApplication app(argc, argv);
- app.setApplicationName("about");
- app.setApplicationVersion("1.2.3");
+ app.setApplicationName(POI_NAME);
+ app.setApplicationVersion(POI_SHORT_VERSION);
AboutDialog dlg;
QObject::connect(&dlg, &AboutDialog::finished, &app, &QApplication::quit);
@@ -17,5 +18,4 @@ int main(int argc, char **argv)
}
return app.exec();
-}
-
+} \ No newline at end of file