Files
pay/qml_path_helper.cpp.in
T
tomFlowee b69b388d9c Split translations and add proof-of-concept mobile
This alters the build setup to create two executables based on
practically the same CPP static lib but with different QML
dirs and translations.
This also adds a cmake option
    -Dlocal_qml=ON
when passed it will create an executable that will load the QML
from local disk instead of using the compiled-in version.
The main advantage of that is that there is no need to recompile
after each QML change.
2021-11-21 00:35:55 +01:00

43 lines
1.3 KiB
Plaintext

/*
* This file is part of the Flowee project
* Copyright (C) 2021 Tom Zander <tom@flowee.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* This is a little method that is auto-populated by cmake
* to have the directory relevant to the users config in order
* to allow fetching the QML files from the git checkout without
* the need to recompile.
*/
#ifndef FLOWEE_PAY_CONFIG_H
#define FLOWEE_PAY_CONFIG_H
#cmakedefine01 local_qml
#cmakedefine QML_PATH "@QML_PATH@"
#include <QQmlApplicationEngine>
void handleLocalQml(QQmlApplicationEngine &engine)
{
#if local_qml
static_assert(sizeof QML_PATH > 0, "FAILED PATH");
engine.setBaseUrl(QUrl(QML_PATH));
#else
engine.setBaseUrl(QUrl("qrc:"));
#endif
}
#endif