2020-04-27 21:23:51 +05:30
VERSION = 4.21.0.0
2016-11-18 15:46:39 +00:00
QMAKE_TARGET_COMPANY = "The pgAdmin Development Team"
QMAKE_TARGET_PRODUCT = "pgAdmin 4"
QMAKE_TARGET_DESCRIPTION = "pgAdmin 4 Desktop Runtime"
2020-01-02 14:43:50 +00:00
QMAKE_TARGET_COPYRIGHT = "Copyright (C) 2013 - 2020, The pgAdmin Development Team"
2016-11-18 15:46:39 +00:00
2020-05-04 10:20:51 +01:00
message ( ================================== )
message ( Configuring the pgAdmin 4 runtime .)
message ( ================================== )
2013-06-16 14:17:46 +01:00
# Configure QT modules for the appropriate version of QT
greaterThan ( QT_MAJOR_VERSION , 4 ) {
2020-05-04 10:20:51 +01:00
message ( Qt version : 5 )
2018-02-05 15:32:14 +00:00
QT += network widgets
2013-06-16 14:17:46 +01:00
} else {
2020-05-04 10:20:51 +01:00
message ( Qt version : 4 )
2018-02-05 15:32:14 +00:00
QT += network
2018-12-06 11:08:17 +00:00
DEFINES += Q_NULLPTR = NULL
2017-04-10 15:15:15 +01:00
}
win32 {
RC_ICONS += pgAdmin4 . ico
2013-06-16 14:17:46 +01:00
}
2016-06-20 12:54:41 +01:00
# Environment settings for the build
QMAKE_CFLAGS += $$ ( PGADMIN_CFLAGS )
QMAKE_CXXFLAGS += $$ ( PGADMIN_CXXFLAGS )
QMAKE_LFLAGS += $$ ( PGADMIN_LDFLAGS )
2020-05-04 10:20:51 +01:00
# Figure out where / what Python looks like and that it's suitable
PYTHON_DIR = $$(PGADMIN_PYTHON_DIR)
2016-02-02 13:16:01 +00:00
2020-05-04 10:20:51 +01:00
equals(PYTHON_DIR, "") {
error(The PGADMIN_PYTHON_DIR environment variable is not set. Please set it to a directory path under which Python 3.4 or later has been installed and try again.)
}
2016-02-02 13:16:01 +00:00
2020-05-04 10:20:51 +01:00
win32 {
message(Platform: Windows)
PYTHON_EXE = $${PYTHON_DIR}\python.exe
} else {
macx {
message(Platform: macOS)
} else {
message(Platform: Linux)
2020-04-30 13:04:09 +05:30
}
2020-05-04 10:20:51 +01:00
PYTHON_EXE = $${PYTHON_DIR}/bin/python3
}
2020-04-30 13:04:09 +05:30
2020-05-04 10:20:51 +01:00
!exists($$PYTHON_EXE) {
error(The Python executable ($$PYTHON_EXE) could not be found. Please ensure the PGADMIN_PYTHON_DIR environment variable is correctly set.)
2013-06-16 14:17:46 +01:00
}
2020-05-04 10:20:51 +01:00
message(Python executable: $$PYTHON_EXE)
2016-01-18 14:33:28 +00:00
2020-05-04 10:20:51 +01:00
PYTHON_VERSION = $$system($$PYTHON_EXE -c \"import sys; print(\' %s.%s\' % (sys.version_info[0], sys.version_info[1]))\")
PYTHON_SHORT_VERSION = $$ system ( $$ PYTHON_EXE - c \ " import sys ; print ( \'%s%s\' % (sys.version_info[0], sys.version_info[1]))\")
PYTHON_MAJOR_VERSION = $$ system ( $$ PYTHON_EXE - c \ " import sys ; print ( sys . version_info [ 0 ]) \ " )
message ( Python version : $$ PYTHON_VERSION ( $$ PYTHON_SHORT_VERSION ))
2016-06-20 11:19:57 +01:00
2020-05-04 10:20:51 +01:00
lessThan ( PYTHON_SHORT_VERSION , 34 ) {
error ( Python 3.4 or later is required to build pgAdmin .)
}
2016-06-17 09:40:06 +01:00
2020-05-04 10:20:51 +01:00
# Configure for the platform
win32 {
INCLUDEPATH = $$ { PYTHON_DIR } \include
message ( Include path : $$ INCLUDEPATH )
2016-02-02 13:16:01 +00:00
2020-05-04 10:20:51 +01:00
LIBS += - L "$$ { PYTHON_DIR } \libs " - lpython$$ { PYTHON_SHORT_VERSION }
message ( LIBS : $$ LIBS )
}
else {
# Find the best matching python - config ( there may be more than one )
exists ( $ PYTHON_DIR / bin / python$$ { PYTHON_VERSION } - config ) {
PYTHON_CONFIG = $$ PYTHON_DIR / bin / python$$ { PYTHON_VERSION } - config
} else : exists ( $$ { PYTHON_DIR } / bin / python$$ { PYTHON_MAJOR_VERSION } - config ) {
PYTHON_CONFIG = $$ { PYTHON_DIR } / bin / python$$ { PYTHON_MAJOR_VERSION } - config
} else : exists ( $$ { PYTHON_DIR } / bin / python - config ) {
PYTHON_CONFIG = $$ { PYTHON_DIR } / bin / python - config
} else {
error ( No suitable python - config could be found in $$ { PYTHON_DIR } / bin .)
}
message ( Python config : $$ PYTHON_CONFIG )
2016-06-17 09:40:06 +01:00
2020-04-29 16:19:54 +01:00
PYTHON_EMBED = $$ system ( $$ PYTHON_CONFIG --help 2 >& 1 | grep - o \'\\-\\-embed\' )
2020-04-29 15:49:16 +01:00
2016-02-02 13:16:01 +00:00
QMAKE_CXXFLAGS += $$ system ( $$ PYTHON_CONFIG --includes )
2020-05-04 10:20:51 +01:00
message ( CXXFLAGS : $$ QMAKE_CXXFLAGS )
2016-02-02 13:16:01 +00:00
QMAKE_LFLAGS += $$ system ( $$ PYTHON_CONFIG --ldflags )
2020-05-04 10:20:51 +01:00
message ( LDFLAGS : $$ QMAKE_LFLAGS )
2016-06-17 09:40:06 +01:00
2020-05-04 10:20:51 +01:00
LIBS += $$ system ( $$ PYTHON_CONFIG --libs $$ PYTHON_EMBED )
message ( LIBS : $$ LIBS )
2016-02-02 13:16:01 +00:00
}
2013-06-16 14:17:46 +01:00
# Source code
2020-05-04 10:20:51 +01:00
HEADERS = Server . h \
pgAdmin4 . h \
ConfigWindow . h \
TrayIcon . h \
LogWindow . h \
MenuActions . h \
FloatingWindow . h \
Logger . h
SOURCES = pgAdmin4 . cpp \
Server . cpp \
ConfigWindow . cpp \
TrayIcon . cpp \
LogWindow . cpp \
MenuActions . cpp \
FloatingWindow . cpp \
Logger . cpp
FORMS = ConfigWindow . ui \
LogWindow . ui \
FloatingWindow . ui
ICON = pgAdmin4 . icns
QMAKE_INFO_PLIST = Info . plist
RESOURCES += pgadmin4 . qrc \
breeze . qrc
2020-04-13 13:22:00 +05:30
macx {
2020-05-04 10:20:51 +01:00
HEADERS += macos . h
OBJECTIVE_SOURCES = macos . mm
2020-04-13 13:22:00 +05:30
}
2016-01-25 17:21:00 +00:00