Skip to content

Commit 198e2cf

Browse files
committed
Fix python deployment on mac
1 parent f335a9d commit 198e2cf

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,4 @@ tests/unit_tests/coverage*
7979
parts
8080
prime
8181
stage
82+
3rdparty/python*

3rdparty/pyotherside.pri

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ win32* {
44
QMAKE_LIBS += -LC:\Python37-x64\libs -lpython37
55
INCLUDEPATH += C:\Python37-x64\include\
66
} else {
7-
PYTHON_CONFIG = python3-config
7+
unix:macx {
8+
PYTHON_CONFIG = $$PWD/python-3/bin/python3-config
9+
} else {
10+
PYTHON_CONFIG = python3-config
11+
}
812
QMAKE_LIBS += $$system($$PYTHON_CONFIG --ldflags --libs)
913
QMAKE_CXXFLAGS += $$system($$PYTHON_CONFIG --includes)
1014
}

src/app/app.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "app.h"
22

33
#include <qpython.h>
4+
#include <pythonlib_loader.h>
45
#include <qredisclient/redisclient.h>
56
#include <QMessageBox>
67
#include <QNetworkProxyFactory>
@@ -226,10 +227,12 @@ void Application::initUpdater() {
226227
}
227228

228229
void Application::initPython() {
230+
#ifdef Q_OS_MACOS
231+
PythonLibLoader::extractPythonLibrary();
232+
#endif
229233
m_python = QSharedPointer<QPython>(new QPython(this, 1, 5));
230234
m_python->addImportPath("qrc:/python/");
231-
m_python->addImportPath(applicationDirPath());
232-
qDebug() << applicationDirPath();
235+
m_python->addImportPath(applicationDirPath());
233236
}
234237

235238
void Application::installTranslator() {

0 commit comments

Comments
 (0)