summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2012-01-25 16:15:47 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2012-01-25 16:15:47 (GMT)
commit3c5489bd0f124945022a0ff36e0915f63ea59915 (patch)
treecd0fd0cd6449e4c47080f33e5444f4383a4e94ca /Tests
parentd05d71389aba168aa7cb4d95f5b22de0ce02596c (diff)
parent8d830436a42ec06555334b5c5ec73b41328d5f06 (diff)
downloadCMake-3c5489bd0f124945022a0ff36e0915f63ea59915.zip
CMake-3c5489bd0f124945022a0ff36e0915f63ea59915.tar.gz
CMake-3c5489bd0f124945022a0ff36e0915f63ea59915.tar.bz2
Merge topic 'test_find_modules'
8d83043 AllFindModules test: also check Qt3 modules if Qt4 is not found e797e7f AllFindModules test: keep complete output ec631d5 add a test that loops through most Find* modules
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeOnly/AllFindModules/CMakeLists.txt39
-rw-r--r--Tests/CMakeOnly/CMakeLists.txt2
2 files changed, 41 insertions, 0 deletions
diff --git a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt
new file mode 100644
index 0000000..8a38f06
--- /dev/null
+++ b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt
@@ -0,0 +1,39 @@
+cmake_minimum_required (VERSION 2.8)
+project(AllFindModules)
+
+if (POLICY CMP0017)
+ cmake_policy(SET CMP0017 NEW)
+endif ()
+
+# Avoid ctest truncation of output
+message(STATUS "CTEST_FULL_OUTPUT")
+
+file(GLOB FIND_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../Modules/Find*.cmake" )
+
+macro(do_find MODULE_NAME)
+ message(STATUS " Checking Find${MODULE_NAME}")
+ find_package(${MODULE_NAME})
+endmacro(do_find)
+
+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")
+ 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")
+ do_find(${FIND_MODULE})
+ endforeach(FIND_MODULE)
+endif(NOT QT4_FOUND)
diff --git a/Tests/CMakeOnly/CMakeLists.txt b/Tests/CMakeOnly/CMakeLists.txt
index f6aa9b5..20e6a3a 100644
--- a/Tests/CMakeOnly/CMakeLists.txt
+++ b/Tests/CMakeOnly/CMakeLists.txt
@@ -14,3 +14,5 @@ set_property(TEST CMakeOnly.LinkInterfaceLoop PROPERTY TIMEOUT 90)
add_CMakeOnly_test(CheckSymbolExists)
add_CMakeOnly_test(CheckCXXSymbolExists)
+
+add_CMakeOnly_test(AllFindModules)