Qt World Summit: Register Today!

qmake custom compiler use output

  • I am using a custom compiler for qmake to create translations:

    lrelease_compiler.name = lrelease ${QMAKE_FILE_IN}
    lrelease_compiler.input = TRANSLATIONS
    lrelease_compiler.variable_out = TRANSLATIONS_QM
    lrelease_compiler.commands = lrelease ${QMAKE_FILE_IN} -qm ${QMAKE_FILE_OUT}
    lrelease_compiler.output = $$OUT_PWD/${QMAKE_FILE_BASE}.qm
    lrelease_compiler.CONFIG += no_link target_predeps
    QMAKE_EXTRA_COMPILERS += lrelease_compiler

    The compiler itself works as expected, but the TRANSLATIONS_QM variable stays empty. I want to use the out variable for a install target, as it should theoretically contain the qm-versions of the files, but it doesn't

    ts_install.path = $$[QT_INSTALL_TRANSLATIONS]
    ts_install.CONFIG += no_check_exist
    ts_install.files += $$TRANSLATIONS_QM
    INSTALLS += ts_install

    The message directive returns nothing, and the install target is not added to the makefile, i.e. running make install will not copy the generated qm files.

    Is there a way to make use of the variable_out for that purpose?