summaryrefslogtreecommitdiffstats
path: root/tests/auto/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/cmake')
-rw-r--r--tests/auto/cmake/CMakeLists.txt5
-rw-r--r--tests/auto/cmake/test_openglextensions_module/CMakeLists.txt22
-rw-r--r--tests/auto/cmake/test_openglextensions_module/main.cpp56
-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
6 files changed, 137 insertions, 1 deletions
diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt
index 7be3116cbd..8f97c0eb7a 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)
if (NOT NO_WIDGETS)
expect_pass(test_dependent_modules)
@@ -118,3 +120,4 @@ test_module_includes(
${qt_module_includes}
)
expect_pass(test_concurrent_module)
+expect_pass(test_openglextensions_module)
diff --git a/tests/auto/cmake/test_openglextensions_module/CMakeLists.txt b/tests/auto/cmake/test_openglextensions_module/CMakeLists.txt
new file mode 100644
index 0000000000..3c23bce2bd
--- /dev/null
+++ b/tests/auto/cmake/test_openglextensions_module/CMakeLists.txt
@@ -0,0 +1,22 @@
+
+cmake_minimum_required(VERSION 2.8)
+
+project(test_openglextensions_module)
+
+find_package(Qt5OpenGLExtensions 5.1.0 REQUIRED)
+
+include_directories(
+ ${Qt5OpenGLExtensions_INCLUDE_DIRS}
+)
+
+add_definitions(
+ ${Qt5OpenGLExtensions_DEFINITIONS}
+)
+
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5OpenGLExtensions_EXECUTABLE_COMPILE_FLAGS}")
+
+add_executable(mainapp main.cpp)
+
+target_link_libraries(mainapp
+ ${Qt5OpenGLExtensions_LIBRARIES}
+)
diff --git a/tests/auto/cmake/test_openglextensions_module/main.cpp b/tests/auto/cmake/test_openglextensions_module/main.cpp
new file mode 100644
index 0000000000..cb4847a691
--- /dev/null
+++ b/tests/auto/cmake/test_openglextensions_module/main.cpp
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtOpenGLExtensions>
+#include <QtOpenGLExtensions/QtOpenGLExtensions>
+#include <QtOpenGLExtensions/QOpenGLExtensions>
+#include <QOpenGLExtensions>
+
+int main(int argc, char **argv)
+{
+#if defined(QT_OPENGL_ES_2)
+ QOpenGLExtension_OES_vertex_array_object obj;
+#else
+ QOpenGLExtension_ARB_draw_buffers obj;
+#endif
+
+ return 0;
+}
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..2099e36068
--- /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 5.1.0
+ 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()