diff options
author | Dominik Holland <dominik.holland@pelagicore.com> | 2017-06-14 17:53:48 +0200 |
---|---|---|
committer | Dominik Holland <dominik.holland@pelagicore.com> | 2017-07-04 08:56:24 +0000 |
commit | 107832b9e27319e9104e3b68d76a4d0f326567f6 (patch) | |
tree | 5373eeb4aaefc288852405d37201f91f98e4a70a /src/tools/ivigenerator/qface_internal_build.pri | |
parent | 94edf1d2d917a2e969e7bce86df3e7e61346027a (diff) | |
download | qtivi-107832b9e27319e9104e3b68d76a4d0f326567f6.tar.gz |
Use the new configure system for detecting python3 and the packages
The python3 excutable and the version checking is now done
in a special test function inside configure.pri.
For python3 packages a separate test function has been
written, which checks whether the requested packages
are installed.
The configuration summary prints the used python
executable as well as its version.
Task-number: QTAUTO-458
Change-Id: I1280ba0acaf3393dcb83132aaa19572a75d97d22
Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
Diffstat (limited to 'src/tools/ivigenerator/qface_internal_build.pri')
-rw-r--r-- | src/tools/ivigenerator/qface_internal_build.pri | 34 |
1 files changed, 4 insertions, 30 deletions
diff --git a/src/tools/ivigenerator/qface_internal_build.pri b/src/tools/ivigenerator/qface_internal_build.pri index 1fd226b..7c66e02 100644 --- a/src/tools/ivigenerator/qface_internal_build.pri +++ b/src/tools/ivigenerator/qface_internal_build.pri @@ -5,40 +5,14 @@ debug_and_release:build_pass:CONFIG(release, debug|release) { return(); } -!exists($$QFACE_SOURCE_DIR): error("Couldn't find $$QFACE_SOURCE_DIR: Please make sure all submodules are initialized") +!exists($$QFACE_SOURCE_DIR/setup.py): error("Couldn't find $$QFACE_SOURCE_DIR: Please make sure all submodules are initialized") -message("Checking for a valid python & pip installation") - -PYTHON3_PATH = $$(PYTHON3_PATH) -PYTHON3_NAMES = "python3" "python" -for (python3_exe, PYTHON3_NAMES) { - !isEmpty(PYTHON3_PATH): python3_exe = $$shell_path($$PYTHON3_PATH/$$python3_exe) - win32: python3_exe = $${python3_exe}.exe - message("Checking for python executable: $$python3_exe") - py_major_version = $$system("$$python3_exe -c \"import platform; print(platform.python_version_tuple()[0])\"") - equals(py_major_version, 3) { - PYTHON3_EXE = $$python3_exe - break() - } -} - -isEmpty(PYTHON3_EXE) { - error("Didn't find a valid python3 installation in PATH or PYTHON3_PATH $$escape_expand(\n)Please make sure it is setup accordingly.") -} - -message("Checking for pip installation") -pip_version = $$system("$$PYTHON3_EXE -m pip --version") -isEmpty(pip_version) { - error("Didn't find pip with your python installation at: $$PYTHON3_EXE $$escape_expand(\n)Please make sure it is installed.") -} - -VIRTUALENV_EXE = "$$PYTHON3_EXE -m virtualenv" -!isEmpty(PIP3_PATH): VIRTUALENV_EXE = $$shell_path($$PIP3_PATH/virtualenv) -!isEmpty(PIP3_PATH):win32: VIRTUALENV_EXE = $${VIRTUALENV_EXE}.exe +include($$shadowed($$PWD/../../ivicore/qtivicore-config.pri)) +VIRTUALENV_EXE = $$QMAKE_PYTHON3_LOCATION -m virtualenv # virtualenv is always using the default interpreter, which is python2 on many systems" # by adding -p we enforce that the python3 interpreter is used and make sure python3 is installed in the virtualenv -VIRTUALENV_EXE += " -p $$PYTHON3_EXE" +VIRTUALENV_EXE += " -p $$QMAKE_PYTHON3_LOCATION" # Use a Python virtualenv for installing qface, so we don't pollute the user environment qtivi_qface_virtualenv.target = qtivi_qface_virtualenv |