[Add] Added .pro file for MacOS build

Former-commit-id: dc485f34a9
This commit is contained in:
Leroy.H.Y 2019-06-23 18:25:14 -07:00
parent c8120e5a5f
commit ada39fd0b0

View File

@ -68,7 +68,8 @@ else: unix:!android: target.path = /opt/$${TARGET}/bin
WITH_PYTHON = no WITH_PYTHON = no
unix: exists( "/usr/include/python3.7m/Python.h" ) { unix:!macx {
exists( "/usr/include/python3.7m/Python.h" ) {
equals(WITH_PYTHON, "no") { equals(WITH_PYTHON, "no") {
message("Will build with python lib version 3.7.") message("Will build with python lib version 3.7.")
INCLUDEPATH += /usr/include/python3.7m/ INCLUDEPATH += /usr/include/python3.7m/
@ -76,8 +77,10 @@ unix: exists( "/usr/include/python3.7m/Python.h" ) {
WITH_PYTHON = yes WITH_PYTHON = yes
} }
} }
}
unix: exists( "/usr/include/python3.6m/Python.h" ) { unix:!macx {
exists( "/usr/include/python3.6m/Python.h" ) {
equals(WITH_PYTHON, "no") { equals(WITH_PYTHON, "no") {
message("Will build with python lib version 3.6.") message("Will build with python lib version 3.6.")
INCLUDEPATH += /usr/include/python3.6m/ INCLUDEPATH += /usr/include/python3.6m/
@ -85,8 +88,10 @@ unix: exists( "/usr/include/python3.6m/Python.h" ) {
WITH_PYTHON = yes WITH_PYTHON = yes
} }
} }
}
unix: exists( "/usr/include/python3.5m/Python.h" ) { unix:!macx {
exists( "/usr/include/python3.5m/Python.h" ) {
equals(WITH_PYTHON, "no") { equals(WITH_PYTHON, "no") {
message("Will build with python lib version 3.5.") message("Will build with python lib version 3.5.")
INCLUDEPATH += /usr/include/python3.5m/ INCLUDEPATH += /usr/include/python3.5m/
@ -94,6 +99,19 @@ unix: exists( "/usr/include/python3.5m/Python.h" ) {
WITH_PYTHON = yes WITH_PYTHON = yes
} }
} }
}
macx {
PYTHON_ROOT=/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions
exists( "$$PYTHON_ROOT/3.7/include/python3.7m/Python.h" ) {
equals(WITH_PYTHON, "no") {
message("Will build with python lib version 3.7.3.")
INCLUDEPATH += $$PYTHON_ROOT/3.7/include/python3.7m/
LIBS += -L$$PYTHON_ROOT/3.7/lib/python3.7/config-3.7m-darwin/ -lpython3.7m
WITH_PYTHON = yes
}
}
}
unix: equals(WITH_PYTHON, "no") { unix: equals(WITH_PYTHON, "no") {
error("No python libs found, did you install python3 dev package?") error("No python libs found, did you install python3 dev package?")