custom-target shell_path shell_quote

Source

python_modules = $$usrlibs/python_modules
DESTDIR = $$python_modules/labbcan
 
...
 
# generate a labbcan.pyi stub file to enable type checking and intellisense
# this requires that python is in PATH, and that mypy and PySide6 are installed
win32: generate_stubs.commands = set PYTHONPATH=$$shell_quote($$shell_path($$python_modules)) && stubgen -m labbcan.labbcan --include-private -o $$python_modules
unix: generate_stubs.commands = PYTHONPATH=$$shell_quote($$python_modules) stubgen -m labbcan.labbcan --include-private -o $$python_modules
 
QMAKE_EXTRA_TARGETS += copy_init_file generate_stubs
QMAKE_POST_LINK += $$copy_init_file.commands && $$generate_stubs.commands