Commit 489fbc76 authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Build without widgets on Android

parent e65db0ad
......@@ -33,9 +33,13 @@ ecm_setup_version(${PROJECT_VERSION}
VARIABLE_PREFIX KRECORDER
VERSION_HEADER ${CMAKE_CURRENT_BINARY_DIR}/version.h
)
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Core Gui Widgets Qml QuickControls2 Multimedia Svg)
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Core Gui Qml QuickControls2 Multimedia Svg)
find_package(KF5 ${KF_MIN_VERSION} REQUIRED COMPONENTS Kirigami2 I18n Config)
if(NOT ANDROID)
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Widgets)
endif()
add_subdirectory(src)
install(PROGRAMS org.kde.krecorder.desktop DESTINATION ${KDE_INSTALL_APPDIR})
......
......@@ -16,12 +16,11 @@ set(krecorder_SRCS
)
add_executable(krecorder ${krecorder_SRCS})
target_link_libraries(krecorder
target_link_libraries(krecorder PRIVATE
Qt5::Core
Qt5::Gui
Qt5::Qml
Qt5::Quick
Qt5::Widgets
Qt5::QuickControls2
Qt5::Multimedia
Qt5::Svg
......@@ -39,4 +38,6 @@ if(ANDROID)
media-playback-stop media-record audio-input-microphone-symbolic
entry-edit delete settings-configure
)
else()
target_link_libraries(krecorder PRIVATE Qt5::Widgets)
endif()
......@@ -4,8 +4,6 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#include <QApplication>
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QtQml>
#include <QUrl>
......@@ -13,6 +11,12 @@
#include <QAudioRecorder>
#include <QCommandLineParser>
#ifdef Q_OS_ANDROID
#include <QGuiApplication>
#else
#include <QApplication>
#endif
#include "recordingmodel.h"
#include "utils.h"
#include "audioplayer.h"
......@@ -26,7 +30,13 @@ Q_DECL_EXPORT int main(int argc, char *argv[])
QCommandLineParser parser;
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
parser.addVersionOption();
#ifdef Q_OS_ANDROID
QGuiApplication app(argc, argv);
#else
QApplication app(argc, argv);
#endif
QCoreApplication::setOrganizationName("KDE");
QCoreApplication::setOrganizationDomain("kde.org");
QCoreApplication::setApplicationName("KRecorder");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment