diff options
author | Stephen Kelly <stephen.kelly@kdab.com> | 2011-12-05 02:06:21 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-12-06 16:57:16 +0100 |
commit | e8f27a71bb96b0126539bc8ed29edb37254fa5ff (patch) | |
tree | ec614be50229e235fd2ce1c95674e102c1a04519 /src/widgets | |
parent | db5b3afa0123bedb25ffef11bf6347f9c63caae9 (diff) |
Port to CMakeParseArguments from a custom rolled macro.
Change-Id: Ia7bf5046420ee8f2d690d098937a212eb75b07ce
Reviewed-by: Clinton Stimpson <clinton@elemtech.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/Qt5WidgetsMacros.cmake | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/src/widgets/Qt5WidgetsMacros.cmake b/src/widgets/Qt5WidgetsMacros.cmake index 2da068eddb..836656f705 100644 --- a/src/widgets/Qt5WidgetsMacros.cmake +++ b/src/widgets/Qt5WidgetsMacros.cmake @@ -36,28 +36,20 @@ # ###################################### -MACRO (QT5_EXTRACT_OPTIONS _qt5_files _qt5_options) - SET(${_qt5_files}) - SET(${_qt5_options}) - SET(_QT5_DOING_OPTIONS FALSE) - FOREACH(_currentArg ${ARGN}) - IF ("${_currentArg}" STREQUAL "OPTIONS") - SET(_QT5_DOING_OPTIONS TRUE) - ELSE ("${_currentArg}" STREQUAL "OPTIONS") - IF(_QT5_DOING_OPTIONS) - LIST(APPEND ${_qt5_options} "${_currentArg}") - ELSE(_QT5_DOING_OPTIONS) - LIST(APPEND ${_qt5_files} "${_currentArg}") - ENDIF(_QT5_DOING_OPTIONS) - ENDIF ("${_currentArg}" STREQUAL "OPTIONS") - ENDFOREACH(_currentArg) -ENDMACRO (QT5_EXTRACT_OPTIONS) +include(CMakeParseArguments) # QT5_WRAP_UI(outfiles inputfile ... ) MACRO (QT5_WRAP_UI outfiles ) - QT5_EXTRACT_OPTIONS(ui_files ui_options ${ARGN}) + set(options) + set(oneValueArgs) + set(multiValueArgs OPTIONS) + + cmake_parse_arguments(_WRAP_UI "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + set(ui_files ${_WRAP_UI_UNPARSED_ARGUMENTS}) + set(ui_options ${_WRAP_UI_OPTIONS}) FOREACH (it ${ui_files}) GET_FILENAME_COMPONENT(outfile ${it} NAME_WE) |