From: Gilles DAVID Date: Wed, 29 Mar 2017 12:34:03 +0000 (+0200) Subject: Add options to PYQT_WRAP_UIC macro X-Git-Tag: V9_0_0~23 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a2d4cd6bfb9ff3c667805dc232a711722e6cea09;p=tools%2Fconfiguration.git Add options to PYQT_WRAP_UIC macro --- diff --git a/cmake/UsePyQt.cmake b/cmake/UsePyQt.cmake index 587aef2..7927ec1 100644 --- a/cmake/UsePyQt.cmake +++ b/cmake/UsePyQt.cmake @@ -57,6 +57,7 @@ ENDFUNCTION() # 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. @@ -65,16 +66,31 @@ ENDFUNCTION() # #################################################################### 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})