mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fix python detection on Linux/Mac.
This commit is contained in:
parent
c702ef9c48
commit
4dc563d71c
@ -48,21 +48,32 @@ win32 {
|
|||||||
else {
|
else {
|
||||||
message(Building for Linux/Mac...)
|
message(Building for Linux/Mac...)
|
||||||
|
|
||||||
PYTHON_CONFIG=python3-config
|
|
||||||
|
|
||||||
# Find and configure Python
|
# Find and configure Python
|
||||||
!system(which python3-config > /dev/null 2>&1) {
|
# Python 3?
|
||||||
!system(which python-config > /dev/null 2>&1) {
|
PYTHON_CONFIG = $$system(which python3-config)
|
||||||
error(The python-config executable could not be found. Ensure Python is installed and in the system path.)
|
|
||||||
} else {
|
# Maybe Python 2?
|
||||||
PYTHON_CONFIG=python-config
|
isEmpty(PYTHON_CONFIG) {
|
||||||
DEFINES += PYTHON2
|
PYTHON_CONFIG = $$system(which python-config)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Argh!
|
||||||
|
isEmpty(PYTHON_CONFIG) {
|
||||||
|
error(The python-config executable could not be found. Ensure Python is installed and in the system path.)
|
||||||
|
}
|
||||||
|
|
||||||
|
message(Using $$PYTHON_CONFIG)
|
||||||
|
|
||||||
QMAKE_CXXFLAGS += $$system($$PYTHON_CONFIG --includes)
|
QMAKE_CXXFLAGS += $$system($$PYTHON_CONFIG --includes)
|
||||||
QMAKE_LFLAGS += $$system($$PYTHON_CONFIG --ldflags)
|
QMAKE_LFLAGS += $$system($$PYTHON_CONFIG --ldflags)
|
||||||
LIBS += $$system($$PYTHON_CONFIG --libs)
|
LIBS += $$system($$PYTHON_CONFIG --libs)
|
||||||
|
|
||||||
|
contains( LIBS, -lpython2.* ) {
|
||||||
|
DEFINES += PYTHON2
|
||||||
|
message(Python2 detected.)
|
||||||
|
} else {
|
||||||
|
message(Python3 detected.)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Source code
|
# Source code
|
||||||
|
Loading…
Reference in New Issue
Block a user