summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeOnly/AllFindModules/CMakeLists.txt
diff options
context:
space:
mode:
authorRolf Eike Beer <eike@sf-mail.de>2012-01-26 21:10:31 (GMT)
committerRolf Eike Beer <eike@sf-mail.de>2012-01-26 21:33:33 (GMT)
commit9d72b25a861bdcc69bf08e7494884027c341f7c9 (patch)
tree1f3a5f4d47c9f814a32e802b7550dd817a6aad29 /Tests/CMakeOnly/AllFindModules/CMakeLists.txt
parent208569f1da0cf2c481f4b377ad4fe542a3a74e2a (diff)
downloadCMake-9d72b25a861bdcc69bf08e7494884027c341f7c9.zip
CMake-9d72b25a861bdcc69bf08e7494884027c341f7c9.tar.gz
CMake-9d72b25a861bdcc69bf08e7494884027c341f7c9.tar.bz2
CMakeOnly.AllFindModules: clean up the Qt3/Qt4 code
Diffstat (limited to 'Tests/CMakeOnly/AllFindModules/CMakeLists.txt')
-rw-r--r--Tests/CMakeOnly/AllFindModules/CMakeLists.txt22
1 files changed, 11 insertions, 11 deletions
diff --git a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt
index 8a38f06..d28ac01 100644
--- a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt
+++ b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt
@@ -15,25 +15,25 @@ macro(do_find MODULE_NAME)
find_package(${MODULE_NAME})
endmacro(do_find)
+# It is only possible to use either Qt3 or Qt4 in one project.
+# Since FindQt will complain if both are found we explicitely
+# filter out this and FindQt3. FindKDE3 also depends on Qt3 and
+# is therefore also blocked
+set(NO_QT4_MODULES "Qt" "Qt3" "KDE3")
+
foreach(FIND_MODULE ${FIND_MODULES})
string(REGEX REPLACE ".*/Find(.*)\\.cmake$" "\\1" MODULE_NAME "${FIND_MODULE}")
- # It is only possible to use either Qt3 or Qt4 in one project.
- # Since FindQt will complain if both are found we explicitely
- # filter out this and FindQt3. FindKDE3 also depends on Qt3 and
- # is therefore also blocked
-
- if (NOT MODULE_NAME STREQUAL "Qt" AND
- NOT MODULE_NAME STREQUAL "Qt3" AND
- NOT MODULE_NAME STREQUAL "KDE3")
+ list(FIND NO_QT4_MODULES ${MODULE_NAME} NO_QT4_INDEX)
+ if (NO_QT4_INDEX EQUAL -1)
do_find(${MODULE_NAME})
endif ()
endforeach(FIND_MODULE)
# Qt4 is not present, so we can check Qt3
-if(NOT QT4_FOUND)
- foreach(FIND_MODULE "Qt3" "Qt" "KDE3")
+if (NOT QT4_FOUND)
+ foreach(FIND_MODULE ${NO_QT4_MODULES})
do_find(${FIND_MODULE})
endforeach(FIND_MODULE)
-endif(NOT QT4_FOUND)
+endif (NOT QT4_FOUND)