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 {
|
||||
message(Building for Linux/Mac...)
|
||||
|
||||
PYTHON_CONFIG=python3-config
|
||||
|
||||
# Find and configure Python
|
||||
!system(which python3-config > /dev/null 2>&1) {
|
||||
!system(which python-config > /dev/null 2>&1) {
|
||||
error(The python-config executable could not be found. Ensure Python is installed and in the system path.)
|
||||
} else {
|
||||
PYTHON_CONFIG=python-config
|
||||
DEFINES += PYTHON2
|
||||
}
|
||||
# Python 3?
|
||||
PYTHON_CONFIG = $$system(which python3-config)
|
||||
|
||||
# Maybe Python 2?
|
||||
isEmpty(PYTHON_CONFIG) {
|
||||
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_LFLAGS += $$system($$PYTHON_CONFIG --ldflags)
|
||||
LIBS += $$system($$PYTHON_CONFIG --libs)
|
||||
|
||||
contains( LIBS, -lpython2.* ) {
|
||||
DEFINES += PYTHON2
|
||||
message(Python2 detected.)
|
||||
} else {
|
||||
message(Python3 detected.)
|
||||
}
|
||||
}
|
||||
|
||||
# Source code
|
||||
|
Loading…
Reference in New Issue
Block a user