# ARGUMENTS:
# output_files [out] variable where output file names are listed to
# pyuic_files [in] list of *.ui files
+# options [in] additional options to be specified to pyuic
#
# NOTES:
# - Input files are considered relative to the current source directory.
#
####################################################################
MACRO(PYQT_WRAP_UIC outfiles)
+ SET(_output)
+ SET(_options)
+ SET(_pyuic_files)
+ SET(_get_options "0")
+ FOREACH(_input ${ARGN})
+ IF(${_input} STREQUAL "OPTIONS")
+ SET(_get_options "1")
+ ELSE()
+ IF(${_get_options} STREQUAL "1")
+ SET(_options ${_options} ${_input})
+ ELSE()
+ SET(_pyuic_files ${_pyuic_files} ${_input})
+ ENDIF()
+ ENDIF()
+ ENDFOREACH()
IF(NOT WIN32)
- FOREACH(_input ${ARGN})
+ FOREACH(_input ${_pyuic_files})
GET_FILENAME_COMPONENT(_input_name ${_input} NAME)
STRING(REPLACE ".ui" "_ui.py" _input_name ${_input_name})
SET(_output ${CMAKE_CURRENT_BINARY_DIR}/${_input_name})
ADD_CUSTOM_COMMAND(
OUTPUT ${_output}
- COMMAND ${PYQT_PYUIC_PATH} -o ${_output} ${CMAKE_CURRENT_SOURCE_DIR}/${_input}
+ COMMAND ${PYQT_PYUIC_PATH} ${_options} -o ${_output} ${CMAKE_CURRENT_SOURCE_DIR}/${_input}
MAIN_DEPENDENCY ${_input}
)
SET(${outfiles} ${${outfiles}} ${_output})