diff --git a/RedPandaIDE/RedPandaIDE.pro b/RedPandaIDE/RedPandaIDE.pro index 9b3d7e45..8a9aee9c 100644 --- a/RedPandaIDE/RedPandaIDE.pro +++ b/RedPandaIDE/RedPandaIDE.pro @@ -5,7 +5,7 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets CONFIG += c++17 CONFIG += nokey -APP_DIR = RedPandaIDE +APP_NAME = RedPandaIDE gcc { QMAKE_CXXFLAGS_RELEASE += -Werror=return-type @@ -344,8 +344,8 @@ TRANSLATIONS += \ RedPandaIDE_zh_CN.ts # Default rules for deployment. -qnx: target.path = /tmp/$${APP_DIR}/bin -else: unix:!android: target.path = /opt/$${APP_DIR}/bin +qnx: target.path = /tmp/$${APP_NAME}/bin +else: unix:!android: target.path = /opt/$${APP_NAME}/bin !isEmpty(target.path): INSTALLS += target RESOURCES += \ diff --git a/RedPandaIDE/settings.cpp b/RedPandaIDE/settings.cpp index 17475a71..cba4a12f 100644 --- a/RedPandaIDE/settings.cpp +++ b/RedPandaIDE/settings.cpp @@ -177,16 +177,13 @@ QString Settings::Dirs::appLibDir() const #ifdef Q_OS_WIN return appDir(); #elif defined(Q_OS_LINUX) - if (isGreenEdition()) { - return appDir(); - } - return includeTrailingPathDelimiter(PREFIX)+"lib"; + return QFileInfo(includeTrailingPathDelimiter(appDir())+"../lib").absolutePath(); #endif } QString Settings::Dirs::templateDir() const { - return includeTrailingPathDelimiter(appDir()) + "templates"; + return includeTrailingPathDelimiter(appLibDir()) + "templates"; } QString Settings::Dirs::projectDir() const diff --git a/RedPandaIDE/systemconsts.h b/RedPandaIDE/systemconsts.h index 756761c9..e60b313f 100644 --- a/RedPandaIDE/systemconsts.h +++ b/RedPandaIDE/systemconsts.h @@ -19,10 +19,6 @@ #include -#ifndef PREFIX -#define PREFIX "/usr/local" -#endif - #define APP_SETTSINGS_FILENAME "redpandacpp.ini" #ifdef Q_OS_WIN #define GCC_PROGRAM "gcc.exe" diff --git a/Red_Panda_CPP.pro b/Red_Panda_CPP.pro index a7a2aab7..d2ed8a8a 100644 --- a/Red_Panda_CPP.pro +++ b/Red_Panda_CPP.pro @@ -6,7 +6,9 @@ SUBDIRS += \ APP_NAME = RedPandaIDE -resources.path = /opt/$${APP_NAME} -resources.files += linux/* +linux: { + resources.path = /opt/$${APP_NAME} + resources.files += linux/* -INSTALLS += resources + INSTALLS += resources +} diff --git a/consolepauser/consolepauser.pro b/consolepauser/consolepauser.pro index 69f1dcbf..9d9a4c69 100644 --- a/consolepauser/consolepauser.pro +++ b/consolepauser/consolepauser.pro @@ -3,7 +3,7 @@ QT -= gui CONFIG += c++11 console CONFIG -= app_bundle -APP_DIR = RedPandaIDE +APP_NAME = RedPandaIDE # You can make your code fail to compile if it uses deprecated APIs. # In order to do so, uncomment the following line. @@ -25,6 +25,6 @@ CONFIG += lrelease CONFIG += embed_translations # Default rules for deployment. -qnx: target.path = /tmp/$${APP_DIR}/bin -else: unix:!android: target.path = /opt/$${APP_DIR}/bin +qnx: target.path = /tmp/$${APP_NAME}/bin +else: unix:!android: target.path = /opt/$${APP_NAME}/bin !isEmpty(target.path): INSTALLS += target