[PyQt] Customizing ui compiler to use pyrcc5?

Patrick Stinson patrickkidd at gmail.com
Wed Apr 22 15:52:00 BST 2020


Yeah, I thought about that. Seems prudent, though I have enough of this project but in qmake and have just released so it still makes sense to keep working with qmake for a bit.

For the record, this seems to have helped:


win32 {
    SIP_PLATFORM = WS_WIN
} macx {
    SIP_PLATFORM = WS_MACX
} linux-g++ {
    SIP_PLATFORM = WS_LINUX
}

# sip compiler
sip_compiler.input = SIP_SOURCE
sip_compiler.output = sipAPI${QMAKE_FILE_BASE}.h sip${QMAKE_FILE_BASE}part0.cpp sip${QMAKE_FILE_BASE}part1.cpp sip${QMAKE_FILE_BASE}part2.cpp sip${QMAKE_FILE_BASE}part3.cpp sip${QMAKE_FILE_BASE}part4.cpp
sip_compiler.CONFIG = no_link target_predeps dep_lines
win32 {
    sip_compiler.commands = sip -t $$SIP_PLATFORM -I Z:\\dev\\vendor\\sysroot-dev-win-32\\Python-3.6.4\\sip\\PyQt5 -c . -j 5 -P -o ${QMAKE_FILE_NAME}
} macx|linux-g++ {
    sip_compiler.commands = sip -t $$SIP_PLATFORM `python3 get_some_sip_flags.py` -c . -j 5 -P -o ${QMAKE_FILE_NAME}
}
sip_compiler.variable_out = GENERATED_FILES
sip_compiler.name = SIP ${QMAKE_FILE_IN}
QMAKE_EXTRA_COMPILERS += sip_compiler

target.files = $$TARGET.so
target.depends = sip$$TARGETpart0.cpp sip$$TARGETpart1.cpp sip$$TARGETpart2.cpp sip$$TARGETpart3.cpp sip$$TARGETpart4.cpp
target.CONFIG = no_check_exist

# pyuic5 compiler
pyuic5.input = FORMS
pyuic5.output = ${QMAKE_FILE_BASE}_form.py
pyuic5.dependency_type = TYPE_UI
pyuic5.CONFIG = no_link target_predeps dep_lines
pyuic5.commands = pyuic5 ${QMAKE_FILE_NAME} -o ${QMAKE_FILE_OUT}
pyuic5.variable_out = GENERATED_FILES
pyuic5.name = PyUIC5 ${QMAKE_FILE_IN}
QMAKE_EXTRA_COMPILERS += pyuic5

#pyrcc5 compiler
pyrcc5.input = RESOURCES
pyrcc5.output = qrc_${QMAKE_FILE_BASE}.py
pyrcc5.dependency_type = TYPE_RCC
pyrcc5.CONFIG = no_link target_predeps dep_lines
pyrcc5.commands = pyrcc5 ${QMAKE_FILE_NAME} -o ${QMAKE_FILE_OUT}
QMAKE_EXTRA_COMPILERS += pyrcc5





> On Apr 22, 2020, at 12:58 AM, Giuseppe Corbelli <corbelligiuseppe at mesdan.it> wrote:
> 
> 
> On 4/21/20 8:09 PM, Patrick Stinson wrote:
>> Has anyone tried to create a qmake project that will handle pyqt5 targets? Seems that would have to at least:
>> 1) Customize the ui compiler to use pyrcc5 instead of rcc
>> 2) Build sip submodules (I have actually had some success with this)
>> 3) Figure out a way to simultaneously build for multiple platforms, e.g. macOS and iOS.
>> I am trying get my dev, macOS, iOS, and Windows targets into a single
>> qmake-based build system to simplify development and deployment
>> across platforms.
> 
> As far as I know Qt is moving away from qmake to cmake for QT6[1][2] so I would suggest staying one step ahead and using cmake, which should be already a viable option for QT5.
> 
> [1] https://lists.qt-project.org/pipermail/development/2018-October/034023.html
> [2] https://wiki.qt.io/CMake_Port
> -- 
> Giuseppe Corbelli
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> https://www.riverbankcomputing.com/mailman/listinfo/pyqt

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20200422/7905fea0/attachment.htm>


More information about the PyQt mailing list