summaryrefslogtreecommitdiffstats
path: root/examples/wayland/custom-extension
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2019-09-18 17:14:44 +0200
committerJohan Helsing <johan.helsing@qt.io>2019-11-26 11:29:29 +0000
commit12058b161e5f0d6f76523dc831acc8bdbc027fec (patch)
treeee6e6bf1c2730671544ca799b7ad414abcf17646 /examples/wayland/custom-extension
parentbad0b76e5a7ed73b685848a8fd6a3555b754a81a (diff)
Initial CMake port
The client, compositor, tests, plugins and examples now build. There are still a few minor issues: - The protocol source generation is a bit hacky. - The tests for checking if building CMake projects don't work anymore as they have Qt 5 specific code. They have just been commented out for now. Fixes: QTBUG-78177 Change-Id: Ie17cb05f0cdbd5b098970ce765adaeccf61a8fde Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
Diffstat (limited to 'examples/wayland/custom-extension')
-rw-r--r--examples/wayland/custom-extension/CMakeLists.txt5
-rw-r--r--examples/wayland/custom-extension/compositor/CMakeLists.txt54
-rw-r--r--examples/wayland/custom-extension/cpp-client/CMakeLists.txt41
-rw-r--r--examples/wayland/custom-extension/qml-client/CMakeLists.txt58
4 files changed, 158 insertions, 0 deletions
diff --git a/examples/wayland/custom-extension/CMakeLists.txt b/examples/wayland/custom-extension/CMakeLists.txt
new file mode 100644
index 000000000..408a9174e
--- /dev/null
+++ b/examples/wayland/custom-extension/CMakeLists.txt
@@ -0,0 +1,5 @@
+# Generated from custom-extension.pro.
+
+add_subdirectory(qml-client)
+add_subdirectory(compositor)
+add_subdirectory(cpp-client)
diff --git a/examples/wayland/custom-extension/compositor/CMakeLists.txt b/examples/wayland/custom-extension/compositor/CMakeLists.txt
new file mode 100644
index 000000000..6727e6ad4
--- /dev/null
+++ b/examples/wayland/custom-extension/compositor/CMakeLists.txt
@@ -0,0 +1,54 @@
+# Generated from compositor.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(custom-extension-compositor LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/wayland/custom-extension/compositor")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Qml)
+find_package(Qt6 COMPONENTS WaylandCompositor)
+
+add_qt_gui_executable(custom-extension-compositor
+ customextension.cpp customextension.h
+ main.cpp
+)
+
+qt6_generate_wayland_protocol_server_sources(custom-extension-compositor
+ FILES
+ ${CMAKE_CURRENT_SOURCE_DIR}/../protocol/custom.xml
+)
+target_link_libraries(custom-extension-compositor PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Qml
+ Qt::WaylandCompositor
+)
+
+
+# Resources:
+set(compositor_resource_files
+ "images/background.png"
+ "qml/Screen.qml"
+ "qml/main.qml"
+)
+
+qt6_add_resources(custom-extension-compositor "compositor"
+ PREFIX
+ "/"
+ FILES
+ ${compositor_resource_files}
+)
+
+install(TARGETS custom-extension-compositor
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/wayland/custom-extension/cpp-client/CMakeLists.txt b/examples/wayland/custom-extension/cpp-client/CMakeLists.txt
new file mode 100644
index 000000000..8f3708a19
--- /dev/null
+++ b/examples/wayland/custom-extension/cpp-client/CMakeLists.txt
@@ -0,0 +1,41 @@
+# Generated from cpp-client.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(custom-extension-cpp-client LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/wayland/custom-extension/cpp-client")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS WaylandClient)
+
+add_qt_gui_executable(custom-extension-cpp-client
+ ../client-common/customextension.cpp ../client-common/customextension.h
+ main.cpp
+)
+
+qt6_generate_wayland_protocol_client_sources(custom-extension-cpp-client
+ FILES
+ ${CMAKE_CURRENT_SOURCE_DIR}/../protocol/custom.xml
+)
+target_link_libraries(custom-extension-cpp-client PRIVATE
+ Qt::GuiPrivate
+)
+
+target_link_libraries(custom-extension-cpp-client PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::WaylandClient
+)
+
+install(TARGETS custom-extension-cpp-client
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/wayland/custom-extension/qml-client/CMakeLists.txt b/examples/wayland/custom-extension/qml-client/CMakeLists.txt
new file mode 100644
index 000000000..f490b507d
--- /dev/null
+++ b/examples/wayland/custom-extension/qml-client/CMakeLists.txt
@@ -0,0 +1,58 @@
+# Generated from qml-client.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(custom-extension-qml-client LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/wayland/custom-extension/qml-client")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Qml)
+find_package(Qt6 COMPONENTS Quick)
+find_package(Qt6 COMPONENTS WaylandClient)
+
+add_qt_gui_executable(custom-extension-qml-client
+ ../client-common/customextension.cpp ../client-common/customextension.h
+ main.cpp
+)
+
+qt6_generate_wayland_protocol_client_sources(custom-extension-qml-client
+ FILES
+ ${CMAKE_CURRENT_SOURCE_DIR}/../protocol/custom.xml
+)
+target_link_libraries(custom-extension-qml-client PRIVATE
+ Qt::GuiPrivate
+)
+
+target_link_libraries(custom-extension-qml-client PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Qml
+ Qt::Quick
+ Qt::WaylandClient
+)
+
+
+# Resources:
+set(qml_resource_files
+ "main.qml"
+)
+
+qt6_add_resources(custom-extension-qml-client "qml"
+ PREFIX
+ "/"
+ FILES
+ ${qml_resource_files}
+)
+
+install(TARGETS custom-extension-qml-client
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)