2
* Copyright (C) 2015 Canonical, Ltd.
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; version 3.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
21
#include <QtCore/QCoreApplication>
22
#include <QtCore/QDir>
23
#include <QtGui/QIcon>
24
#include <QtQml/QQmlEngine>
25
#include <QStandardPaths>
27
inline bool isRunningInstalled() {
28
static bool installed = (QCoreApplication::applicationDirPath() ==
29
QDir(("@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@")).canonicalPath());
33
inline QString qmlDirectory() {
34
if (isRunningInstalled()) {
35
return QString("@CMAKE_INSTALL_PREFIX@/@QTMIR_DATA_DIR@/");
37
return QString("@CMAKE_SOURCE_DIR@/miral-qt/demos/");
41
inline QString qmlPluginDirectory() {
42
if (isRunningInstalled()) {
43
return QString("@QML_MODULE_INSTALL_DIR@/");
45
return QString("@CMAKE_BINARY_DIR@/miral-qt/src/modules/");
49
inline QString qpaPluginDirectory() {
50
if (isRunningInstalled()) {
51
return QString("@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/qt5/plugins/platforms/");
53
//return QString("@CMAKE_BINARY_DIR@/miral-qt/src/platforms/mirserver/"); //miral moving it out of here
54
return QString("@CMAKE_BINARY_DIR@/lib/");