ENH: Better QT4_EXTRACT_OPTIONS macro.

This commit is contained in:
Clinton Stimpson 2007-12-19 16:48:04 -05:00
parent 3a304f8e1b
commit fffb0bd908
1 changed files with 15 additions and 14 deletions

View File

@ -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)