summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZoltan Gera <zoltan.gera@qt.io>2023-02-14 17:38:48 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-02-15 07:58:20 +0000
commitddd13ca88edbc0d76974d67a9fbfd212f46955a1 (patch)
tree8f221d4148c0f028017ddff3a7bd87621712516a
parentdf40b0e4d248599a349f9b88d9d418504e8c73ed (diff)
Fix improper handling of qmake variables when creating a virtualenv
The qmake function $$first only accepts a variable and does not work on substituted strings. In the latter case, it returns an empty value. As a result PYTHONPATH became /site-packages without a proper lead-in path. Some platforms can handle this but on most a full path is expected. Change-Id: Ieb9e13369190036ed1806086dd93810df5921619 Reviewed-by: Robert Griebl <robert.griebl@qt.io> (cherry picked from commit e1dbb23b2c965c8a3867e79fd3b1b99bf9524b1f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--mkspecs/features/ifcodegen.prf6
1 files changed, 4 insertions, 2 deletions
diff --git a/mkspecs/features/ifcodegen.prf b/mkspecs/features/ifcodegen.prf
index 5901d142..474340ff 100644
--- a/mkspecs/features/ifcodegen.prf
+++ b/mkspecs/features/ifcodegen.prf
@@ -59,7 +59,8 @@ IF_TEMPLATE_PATH = $$[QT_INSTALL_DATA]/ifcodegen-templates
exists($$VIRTUALENV_PATH) {
equals(QMAKE_HOST.os, Windows) {
PYTHON = $$VIRTUALENV_PATH/Scripts/python.exe
- _LIB_FOLDER = $$first($$files($$VIRTUALENV_PATH/lib/python*))
+ _LIB_FOLDERS = $$files($$VIRTUALENV_PATH/lib/python*)
+ _LIB_FOLDER = $$first(_LIB_FOLDERS)
SITE_PACKAGES = $${_LIB_FOLDER}/site-packages
# No space between the path and && otherwise python3 adds the space to the path
@@ -68,7 +69,8 @@ exists($$VIRTUALENV_PATH) {
ENV += set VIRTUAL_ENV=%PYTHONHOME%&&
} else {
PYTHON = $$VIRTUALENV_PATH/bin/python
- _LIB_FOLDER = $$first($$files($$VIRTUALENV_PATH/lib/python*))
+ _LIB_FOLDERS = $$files($$VIRTUALENV_PATH/lib/python*)
+ _LIB_FOLDER = $$first(_LIB_FOLDERS)
SITE_PACKAGES = $${_LIB_FOLDER}/site-packages
ENV += LD_LIBRARY_PATH="$$system_path($$VIRTUALENV_PATH/bin)"