diff options
-rw-r--r-- | mkspecs/features/ivigenerator.prf | 10 | ||||
-rw-r--r-- | src/tools/ivigenerator/qface_internal_build.pri | 10 |
2 files changed, 19 insertions, 1 deletions
diff --git a/mkspecs/features/ivigenerator.prf b/mkspecs/features/ivigenerator.prf index 346ade9..487dcbe 100644 --- a/mkspecs/features/ivigenerator.prf +++ b/mkspecs/features/ivigenerator.prf @@ -58,6 +58,16 @@ Makefile.target = $$MAKEFILE # when using a QMAKE_EXTRA_COMPILER Makefile.depends = $$relative_path($$qface_sources.output, $$OUT_PWD) +# Make the qmake_all target work for usage inside QtCreator +# Because of the Makefile target the generator is called before the actual Makefile +# is evaluated. This is a problem if the virtualenv is not created yet. +# In this case we create the target with a dependency to the forceRebuild file. +# This file is created during the qmake run and updated once the virtualenv is ready +# and will then cause a rerun of qmake +!isEmpty(QTIVI_ROOT):!exists($$VIRTUALENV_PATH): { + Makefile.depends = $$shadowed($$IVI_GENERATOR_PATH)/forceRebuild +} + # After the generation, this should exists and qmake can create the correct build tree exists($$qface_sources.output) { include($$qface_sources.output) diff --git a/src/tools/ivigenerator/qface_internal_build.pri b/src/tools/ivigenerator/qface_internal_build.pri index d2a1026..699d2eb 100644 --- a/src/tools/ivigenerator/qface_internal_build.pri +++ b/src/tools/ivigenerator/qface_internal_build.pri @@ -48,6 +48,12 @@ QMAKE_EXTRA_TARGETS += qtivi_qface_virtualenv win32: VIRTUALENV_ACTIVATION = $${qtivi_qface_virtualenv.target}\Scripts\activate && else: VIRTUALENV_ACTIVATION = . $${qtivi_qface_virtualenv.target}/bin/activate && +# Create the forceRebuild file during the qmake run. +# This file is used as a dependency in other Makefiles. +# Once the virtualenv is created and setup the file will +# be touched to recreate theses Makefiles. +write_file($$OUT_PWD/forceRebuild) + # Always run this target qtivi_qface_install.target = qtivi_qface_virtualenv/pip-selfcheck.json qtivi_qface_install.depends = qtivi_qface_virtualenv @@ -55,7 +61,9 @@ qtivi_qface_install.depends += $$QFACE_SOURCE_DIR/setup.py qtivi_qface_install.depends += $$QFACE_SOURCE_DIR/requirements.txt qtivi_qface_install.commands = $$VIRTUALENV_ACTIVATION \ $$PIP3_EXE install -e $$QFACE_SOURCE_DIR $$escape_expand(\n\t) \ - @echo "Installed qface development version into qtivi_qface_install.target" + @echo "Installed qface development version into qtivi_qface_install.target" $$escape_expand(\n\t) +win32: qtivi_qface_install.commands += @COPY /B $$shell_path($$OUT_PWD/forceRebuild)+,, $$shell_path($$OUT_PWD/forceRebuild) +else: qtivi_qface_install.commands += @touch $$OUT_PWD/forceRebuild QMAKE_EXTRA_TARGETS += qtivi_qface_install PRE_TARGETDEPS += $${qtivi_qface_install.target} |