summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorStephen Kelly <stephen.kelly@kdab.com>2013-01-11 14:53:25 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-01-24 20:37:34 +0100
commit314e5ce5ee03baebff4731c44c0aca871135603d (patch)
treee4b61c3c9d7d50db6ce0a237cf8eed6e26078992 /tests
parentcd1e21cf09c2512b58723ad527dcc1aad102787b (diff)
Add an umbrella cmake config file for Qt 5.
Change-Id: I96b6e96539a84a5919992afbaee757fa080b7ae0 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Alexander Neundorf <neundorf@kde.org> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/cmake/CMakeLists.txt4
-rw-r--r--tests/auto/cmake/test_umbrella_config/CMakeLists.txt20
-rw-r--r--tests/auto/cmake/test_umbrella_config/components_found/CMakeLists.txt18
-rw-r--r--tests/auto/cmake/test_umbrella_config/components_not_found/CMakeLists.txt17
4 files changed, 58 insertions, 1 deletions
diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt
index 46dcdcca2b..b2639f5e0b 100644
--- a/tests/auto/cmake/CMakeLists.txt
+++ b/tests/auto/cmake/CMakeLists.txt
@@ -51,9 +51,11 @@ if(NOT ${CMAKE_VERSION} VERSION_LESS 2.8.9)
# Requires INCLUDE_DIRECTORIES target property in CMake 2.8.8
# and POSITION_INDEPENDENT_CODE target property in 2.8.9
expect_pass(test_use_modules_function)
+ expect_pass(test_umbrella_config)
else()
- message("CMake version older than 2.8.9 (Found ${CMAKE_VERSION}). Not running test \"test_use_modules_function\"")
+ message("CMake version older than 2.8.9 (Found ${CMAKE_VERSION}). Not running test \"test_use_modules_function\" or \"test_umbrella_config\"")
endif()
+
expect_pass(test_wrap_cpp_and_resources)
expect_pass(test_dependent_modules)
expect_fail(test_add_resource_options)
diff --git a/tests/auto/cmake/test_umbrella_config/CMakeLists.txt b/tests/auto/cmake/test_umbrella_config/CMakeLists.txt
new file mode 100644
index 0000000000..a8fc2b53ed
--- /dev/null
+++ b/tests/auto/cmake/test_umbrella_config/CMakeLists.txt
@@ -0,0 +1,20 @@
+
+cmake_minimum_required(VERSION 2.8)
+
+project(test_umbrella_config)
+
+add_subdirectory(components_found)
+
+if (Qt5_FOUND)
+ message(SEND_ERROR "Qt5_FOUND variable leaked!")
+endif()
+
+if (Qt5Core_FOUND)
+ message(SEND_ERROR "Qt5Core_FOUND variable leaked!")
+endif()
+
+if (TARGET Qt5::Core)
+ message(SEND_ERROR "Qt5::Core target leaked!")
+endif()
+
+add_subdirectory(components_not_found)
diff --git a/tests/auto/cmake/test_umbrella_config/components_found/CMakeLists.txt b/tests/auto/cmake/test_umbrella_config/components_found/CMakeLists.txt
new file mode 100644
index 0000000000..91cb623deb
--- /dev/null
+++ b/tests/auto/cmake/test_umbrella_config/components_found/CMakeLists.txt
@@ -0,0 +1,18 @@
+
+# The module finds its dependencies
+find_package(Qt5
+ COMPONENTS Core
+ OPTIONAL_COMPONENTS DoesNotExist
+)
+
+if (NOT Qt5_FOUND)
+ message(SEND_ERROR "Qt5 umbrella package not found!")
+endif()
+
+if (NOT Qt5Core_FOUND)
+ message(SEND_ERROR "Qt5Core package not found!")
+endif()
+
+if (Qt5DoesNotExist_FOUND)
+ message(SEND_ERROR "Non-existent package found!")
+endif()
diff --git a/tests/auto/cmake/test_umbrella_config/components_not_found/CMakeLists.txt b/tests/auto/cmake/test_umbrella_config/components_not_found/CMakeLists.txt
new file mode 100644
index 0000000000..424c3e3445
--- /dev/null
+++ b/tests/auto/cmake/test_umbrella_config/components_not_found/CMakeLists.txt
@@ -0,0 +1,17 @@
+
+# The module finds its dependencies
+find_package(Qt5
+ COMPONENTS Core DoesNotExist
+)
+
+if (Qt5_FOUND)
+ message(SEND_ERROR "Qt5 umbrella package found, though it should not be!")
+endif()
+
+if (NOT Qt5Core_FOUND)
+ message(SEND_ERROR "Qt5Core package not found!")
+endif()
+
+if (Qt5DoesNotExist_FOUND)
+ message(SEND_ERROR "Non-existent package found!")
+endif()