Skip to content

Commit

Permalink
Not hardcode app source dir
Browse files Browse the repository at this point in the history
  • Loading branch information
neochapay committed Nov 17, 2023
1 parent 433ed80 commit b21957c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@

inline bool isRunningInstalled()
{
static bool installed = (QCoreApplication::applicationDirPath() == "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@");
return installed;
return (QCoreApplication::applicationDirPath() == "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@");
}

inline QString appDirectory()
{
bool installed = isRunningInstalled();
QString path = QString("@CMAKE_CURRENT_SOURCE_DIR@/qml/");
QString path = QString(QCoreApplication::applicationDirPath() + "/qml/");
if (installed) {
path = QString("@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_DATADIR@/%1/qml/").arg(qApp->applicationName());
}
Expand Down

0 comments on commit b21957c

Please sign in to comment.