summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominik Holland <dominik.holland@qt.io>2022-12-08 16:23:43 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-12-13 12:31:41 +0000
commitb17de901377e8e3345aa0cd1bbdf1d9c77e79a4a (patch)
tree0ba1f4765c75dfb26ca566061e39e1e8c7c407d5
parent894daa7e1497bf2d8948426697260f494b5cc8de (diff)
ifcodegen: Fix qmake integration when using a dirty virtualenv
During development it can happen that multiple python versions are used to create a virtualenv and installed over one another. This virtualenv has multiple site-packages folders and the qmake integration should still work, by just using the first one found. Change-Id: Iddc0a58875001f3ceb08aab9eae298eb8418f194 Reviewed-by: Robert Griebl <robert.griebl@qt.io> (cherry picked from commit 5ca0c1a5f97d0511cf6c3ad3152c5a7e93f17588) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--mkspecs/features/ifcodegen.prf4
1 files changed, 2 insertions, 2 deletions
diff --git a/mkspecs/features/ifcodegen.prf b/mkspecs/features/ifcodegen.prf
index bccdef9b..5901d142 100644
--- a/mkspecs/features/ifcodegen.prf
+++ b/mkspecs/features/ifcodegen.prf
@@ -59,7 +59,7 @@ IF_TEMPLATE_PATH = $$[QT_INSTALL_DATA]/ifcodegen-templates
exists($$VIRTUALENV_PATH) {
equals(QMAKE_HOST.os, Windows) {
PYTHON = $$VIRTUALENV_PATH/Scripts/python.exe
- _LIB_FOLDER = $$files($$VIRTUALENV_PATH/lib/python*)
+ _LIB_FOLDER = $$first($$files($$VIRTUALENV_PATH/lib/python*))
SITE_PACKAGES = $${_LIB_FOLDER}/site-packages
# No space between the path and && otherwise python3 adds the space to the path
@@ -68,7 +68,7 @@ exists($$VIRTUALENV_PATH) {
ENV += set VIRTUAL_ENV=%PYTHONHOME%&&
} else {
PYTHON = $$VIRTUALENV_PATH/bin/python
- _LIB_FOLDER = $$files($$VIRTUALENV_PATH/lib/python*)
+ _LIB_FOLDER = $$first($$files($$VIRTUALENV_PATH/lib/python*))
SITE_PACKAGES = $${_LIB_FOLDER}/site-packages
ENV += LD_LIBRARY_PATH="$$system_path($$VIRTUALENV_PATH/bin)"