From fffb0bd9088cb3ae3ab152562c376e2ef1461d43 Mon Sep 17 00:00:00 2001 From: Clinton Stimpson Date: Wed, 19 Dec 2007 16:48:04 -0500 Subject: ENH: Better QT4_EXTRACT_OPTIONS macro. --- Modules/FindQt4.cmake | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index 9a6d9ce..500c6ed 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -848,20 +848,21 @@ IF (QT4_QMAKE_FOUND) # ###################################### - MACRO (QT4_EXTRACT_OPTIONS qt4_files qt4_options) - SET(${qt4_files} ${ARGN}) - SET(${qt4_options}) - LIST(FIND ${qt4_files} OPTIONS _index) - IF(NOT _index EQUAL -1) - LIST(REMOVE_ITEM ${qt4_files} OPTIONS) - LIST(LENGTH ${qt4_files} _length) - WHILE(_length GREATER ${_index}) - LIST(GET ${qt4_files} ${_index} _opt_value) - LIST(REMOVE_AT ${qt4_files} ${_index}) - LIST(APPEND ${qt4_options} ${_opt_value}) - LIST(LENGTH ${qt4_files} _length) - ENDWHILE(_length GREATER ${_index}) - ENDIF(NOT _index EQUAL -1) + MACRO (QT4_EXTRACT_OPTIONS _qt4_files _qt4_options) + SET(${_qt4_files}) + SET(${_qt4_options}) + SET(_QT4_DOING_OPTIONS FALSE) + FOREACH(_currentArg ${ARGN}) + IF ("${_currentArg}" STREQUAL "OPTIONS") + SET(_QT4_DOING_OPTIONS TRUE) + ELSE ("${_currentArg}" STREQUAL "OPTIONS") + IF(_QT4_DOING_OPTIONS) + LIST(APPEND ${_qt4_options} "${_currentArg}") + ELSE(_QT4_DOING_OPTIONS) + LIST(APPEND ${_qt4_files} "${_currentArg}") + ENDIF(_QT4_DOING_OPTIONS) + ENDIF ("${_currentArg}" STREQUAL "OPTIONS") + ENDFOREACH(_currentArg) ENDMACRO (QT4_EXTRACT_OPTIONS) MACRO (QT4_GET_MOC_INC_DIRS _moc_INC_DIRS) -- cgit v0.12