mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-01 09:24:10 +01:00
OP-1879 remove openpilot hardcoding: use relative paths define from openpilotgcs.pri for data and plugins paths
This commit is contained in:
parent
c992daddaf
commit
fc791e87dc
@ -98,12 +98,6 @@ isEmpty(TEST):CONFIG(debug, debug|release) {
|
||||
}
|
||||
}
|
||||
|
||||
isEmpty(GCS_LIBRARY_BASENAME) {
|
||||
GCS_LIBRARY_BASENAME = lib
|
||||
}
|
||||
|
||||
DEFINES += GCS_LIBRARY_BASENAME=\\\"$$GCS_LIBRARY_BASENAME\\\"
|
||||
|
||||
equals(TEST, 1) {
|
||||
QT +=testlib
|
||||
DEFINES += WITH_TESTS
|
||||
@ -140,7 +134,6 @@ macx {
|
||||
GCS_PLUGIN_PATH = $$GCS_LIBRARY_PATH
|
||||
GCS_QT_QML_PATH = $$GCS_PATH/Imports
|
||||
GCS_DATA_PATH = $$GCS_PATH/Resources
|
||||
GCS_DATA_BASENAME = Resources
|
||||
GCS_DOC_PATH = $$GCS_DATA_PATH/doc
|
||||
copydata = 1
|
||||
copyqt = 1
|
||||
@ -148,10 +141,9 @@ macx {
|
||||
GCS_APP_TARGET = openpilotgcs
|
||||
GCS_PATH = $$GCS_BUILD_TREE
|
||||
GCS_APP_PATH = $$GCS_PATH/bin
|
||||
GCS_LIBRARY_PATH = $$GCS_PATH/$$GCS_LIBRARY_BASENAME/openpilotgcs
|
||||
GCS_LIBRARY_PATH = $$GCS_PATH/lib/openpilotgcs
|
||||
GCS_PLUGIN_PATH = $$GCS_LIBRARY_PATH/plugins
|
||||
GCS_DATA_PATH = $$GCS_PATH/share/openpilotgcs
|
||||
GCS_DATA_BASENAME = share/openpilotgcs
|
||||
GCS_DOC_PATH = $$GCS_PATH/share/doc
|
||||
|
||||
!isEqual(GCS_SOURCE_TREE, $$GCS_BUILD_TREE):copydata = 1
|
||||
@ -186,9 +178,6 @@ macx {
|
||||
}
|
||||
|
||||
|
||||
DEFINES += GCS_DATA_BASENAME=\\\"$$GCS_DATA_BASENAME\\\"
|
||||
|
||||
|
||||
INCLUDEPATH += \
|
||||
$$GCS_SOURCE_TREE/src/libs
|
||||
|
||||
|
@ -20,6 +20,8 @@ include(../libs/version_info/version_info.pri)
|
||||
|
||||
LIBS *= -l$$qtLibraryName(ExtensionSystem) -l$$qtLibraryName(Aggregation)
|
||||
|
||||
DEFINES += PLUGIN_REL_PATH=\\\"$$relative_path($$GCS_PLUGIN_PATH, $$GCS_APP_PATH)\\\"
|
||||
|
||||
win32 {
|
||||
RC_FILE = openpilotgcs.rc
|
||||
target.path = /bin
|
||||
|
@ -306,25 +306,12 @@ void logInit(QString fileName)
|
||||
inline QStringList getPluginPaths()
|
||||
{
|
||||
QStringList rc;
|
||||
// Figure out root: Up one from 'bin'
|
||||
QDir rootDir = QApplication::applicationDirPath();
|
||||
|
||||
rootDir.cdUp();
|
||||
const QString rootDirPath = rootDir.canonicalPath();
|
||||
// 1) "plugins" (Win/Linux)
|
||||
QString pluginPath = rootDirPath;
|
||||
QString pluginPath = QApplication::applicationDirPath();
|
||||
pluginPath += QLatin1Char('/');
|
||||
pluginPath += QLatin1String(GCS_LIBRARY_BASENAME);
|
||||
pluginPath += QLatin1Char('/');
|
||||
pluginPath += QLatin1String("openpilotgcs");
|
||||
pluginPath += QLatin1Char('/');
|
||||
pluginPath += QLatin1String("plugins");
|
||||
rc.push_back(pluginPath);
|
||||
// 2) "PlugIns" (OS X)
|
||||
pluginPath = rootDirPath;
|
||||
pluginPath += QLatin1Char('/');
|
||||
pluginPath += QLatin1String("Plugins");
|
||||
pluginPath += QLatin1String(PLUGIN_REL_PATH);
|
||||
rc.push_back(pluginPath);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@ -42,15 +42,9 @@ PathUtils::PathUtils()
|
||||
*/
|
||||
QString PathUtils::GetDataPath()
|
||||
{
|
||||
// This routine works with "/" as the standard:
|
||||
// Figure out root: Up one from 'bin'
|
||||
QDir rootDir = QApplication::applicationDirPath();
|
||||
|
||||
rootDir.cdUp();
|
||||
const QString rootDirPath = rootDir.canonicalPath();
|
||||
QString dataPath = rootDirPath;
|
||||
QString dataPath = QApplication::applicationDirPath();
|
||||
dataPath += QLatin1Char('/');
|
||||
dataPath += QLatin1String(GCS_DATA_BASENAME);
|
||||
dataPath += QLatin1String(DATA_REL_PATH);
|
||||
dataPath += QLatin1Char('/');
|
||||
return dataPath;
|
||||
}
|
||||
|
@ -13,6 +13,8 @@ DEFINES += QTCREATOR_UTILS_LIB
|
||||
|
||||
include(../../openpilotgcslibrary.pri)
|
||||
|
||||
DEFINES += DATA_REL_PATH=\\\"$$relative_path($$GCS_DATA_PATH, $$GCS_APP_PATH)\\\"
|
||||
|
||||
SOURCES += reloadpromptutils.cpp \
|
||||
settingsutils.cpp \
|
||||
filesearch.cpp \
|
||||
|
Loading…
Reference in New Issue
Block a user