[cmake-commits] clinton committed FindQt4.cmake 1.83 1.84

cmake-commits at cmake.org cmake-commits at cmake.org
Wed Dec 19 16:48:06 EST 2007


Update of /cvsroot/CMake/CMake/Modules
In directory public:/mounts/ram/cvs-serv2687

Modified Files:
	FindQt4.cmake 
Log Message:
ENH:  Better QT4_EXTRACT_OPTIONS macro.


Index: FindQt4.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/FindQt4.cmake,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -d -r1.83 -r1.84
--- FindQt4.cmake	18 Dec 2007 19:50:18 -0000	1.83
+++ FindQt4.cmake	19 Dec 2007 21:48:04 -0000	1.84
@@ -848,20 +848,21 @@
   #
   ######################################
 
-  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)



More information about the Cmake-commits mailing list