From 183a6a0effdf1332ec445e5d1626b99d550c79a8 Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Mon, 2 Nov 2015 10:43:06 +0100 Subject: CMake: Create CMake files for WaylandClient Also add unit tests Change-Id: I66de887607f73b318884e4a35f18510b90cf0315 Task-number: QTBUG-47357 Reviewed-by: Jan Arne Petersen Reviewed-by: Giulio Camuffo --- src/client/client.pro | 1 - tests/auto/cmake/CMakeLists.txt | 3 +++ tests/auto/cmake/test_waylandclient/CMakeLists.txt | 12 ++++++++++++ tests/auto/cmake/test_waylandclient/main.cpp | 7 +++++++ 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 tests/auto/cmake/test_waylandclient/CMakeLists.txt create mode 100644 tests/auto/cmake/test_waylandclient/main.cpp diff --git a/src/client/client.pro b/src/client/client.pro index ba17b21c..7182f320 100644 --- a/src/client/client.pro +++ b/src/client/client.pro @@ -16,7 +16,6 @@ load(qt_module) QMAKE_CXXFLAGS_WARN_ON -= -Wcast-qual CONFIG -= precompile_header -CONFIG -= create_cmake CONFIG += link_pkgconfig qpa/genericunixfontdatabase wayland-scanner !equals(QT_WAYLAND_GL_CONFIG, nogl) { diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt index a3c4870d..9041fff9 100644 --- a/tests/auto/cmake/CMakeLists.txt +++ b/tests/auto/cmake/CMakeLists.txt @@ -13,3 +13,6 @@ include("${_Qt5CTestMacros}") test_module_includes( Compositor QWaylandBufferRef ) + +# Can't test in `test_module_includes`, WaylandClient has no public headers +expect_pass(test_waylandclient) diff --git a/tests/auto/cmake/test_waylandclient/CMakeLists.txt b/tests/auto/cmake/test_waylandclient/CMakeLists.txt new file mode 100644 index 00000000..3788a492 --- /dev/null +++ b/tests/auto/cmake/test_waylandclient/CMakeLists.txt @@ -0,0 +1,12 @@ +project(test_plugins) + +cmake_minimum_required(VERSION 2.8) +cmake_policy(SET CMP0056 NEW) + +find_package(Qt5WaylandClient REQUIRED) + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}") + +include_directories(${Qt5WaylandClient_PRIVATE_INCLUDE_DIRS}) +add_executable(test_waylandclient_exe main.cpp) +target_link_libraries(test_waylandclient_exe Qt5::WaylandClient) diff --git a/tests/auto/cmake/test_waylandclient/main.cpp b/tests/auto/cmake/test_waylandclient/main.cpp new file mode 100644 index 00000000..f0ccdef4 --- /dev/null +++ b/tests/auto/cmake/test_waylandclient/main.cpp @@ -0,0 +1,7 @@ +#include + +int main() +{ + // use symbol + QtWaylandClient::QWaylandCursor cursor(Q_NULLPTR); +} -- cgit v1.2.1