Add a sed massager to the build script to work around bad Qwt imports in pyuic4.

This commit is contained in:
Nick Foster 2012-07-18 09:15:48 -07:00
parent d6d2bea69f
commit f8ac334dde

View File

@ -34,17 +34,24 @@ endif()
set(PYUIC4_COMPILE pyuic4)
set(RX_UI_SRC ${CMAKE_CURRENT_SOURCE_DIR}/modes_rx.ui)
set(RX_UI_PY_PRE_MASSAGE ${CMAKE_CURRENT_BINARY_DIR}/modes_rx_ui_borked.py)
set(RX_UI_PY ${CMAKE_CURRENT_BINARY_DIR}/modes_rx_ui.py)
set(PYUIC_MASSAGER sed "s/from qwt.* import/from PyQt4.Qwt5.Qwt import/")
add_custom_target(rx_ui ALL
DEPENDS ${RX_UI_PY}
)
add_custom_command(OUTPUT ${RX_UI_PY}
COMMAND ${PYUIC4_COMPILE} ${RX_UI_SRC} > ${RX_UI_PY}
add_custom_command(OUTPUT ${RX_UI_PY_PRE_MASSAGE}
COMMAND ${PYUIC4_COMPILE} ${RX_UI_SRC} > ${RX_UI_PY_PRE_MASSAGE}
MAIN_DEPENDENCY ${RX_UI_SRC}
)
add_custom_command(OUTPUT ${RX_UI_PY}
COMMAND ${PYUIC_MASSAGER} ${RX_UI_PY_PRE_MASSAGE} > ${RX_UI_PY}
MAIN_DEPENDENCY ${RX_UI_PY_PRE_MASSAGE}
)
########################################################################
# Install python sources
########################################################################