2013-06-05 15:00:43 +02:00
|
|
|
# We use python to extract git version info and generate some other files,
|
|
|
|
# but it may be installed locally. The expected python version should be
|
|
|
|
# kept in sync with make/tools.mk.
|
2015-04-05 11:47:59 +02:00
|
|
|
PYTHON_DIR = qt-5.4.1/Tools/mingw491_32/opt/bin
|
2013-06-05 15:00:43 +02:00
|
|
|
|
|
|
|
# Search the python using environment override first
|
2015-07-30 11:29:02 +02:00
|
|
|
TOOLS_DIR = $$(TOOLS_DIR)
|
|
|
|
!isEmpty(TOOLS_DIR):exists($$TOOLS_DIR/$$PYTHON_DIR/python*) {
|
|
|
|
PYTHON = \"$$TOOLS_DIR/$$PYTHON_DIR/python\"
|
2013-06-05 15:00:43 +02:00
|
|
|
} else {
|
|
|
|
# If not found, search the predefined tools path
|
|
|
|
exists($$ROOT_DIR/tools/$$PYTHON_DIR/python*) {
|
|
|
|
PYTHON = \"$$ROOT_DIR/tools/$$PYTHON_DIR/python\"
|
|
|
|
} else {
|
|
|
|
# not found, hope it's in the path...
|
2014-08-23 05:51:56 +02:00
|
|
|
PYTHON_VER = "$$system(python --version 2>&1)"
|
|
|
|
contains(PYTHON_VER, "Python 2.*") {
|
2014-08-23 04:53:22 +02:00
|
|
|
PYTHON = \"python\"
|
|
|
|
} else {
|
|
|
|
PYTHON = \"python2\"
|
|
|
|
}
|
2013-06-05 15:00:43 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
PYTHON = $$replace(PYTHON, \\\\, /)
|
|
|
|
message(Using python interpreter: $$PYTHON)
|