aboutsummaryrefslogtreecommitdiffstats
path: root/examples/websockets/qmlwebsocketclient/CMakeLists.txt
diff options
context:
space:
mode:
authorKai Köhne <kai.koehne@qt.io>2022-02-14 19:50:46 +0100
committerKai Köhne <kai.koehne@qt.io>2022-02-19 08:56:50 +0100
commitfef6885a446165a02973c84469c87bebae389b96 (patch)
tree762d7762a7d9adfc14b92ff1e4aa44ba1500457d /examples/websockets/qmlwebsocketclient/CMakeLists.txt
parent34eb3a620bc28a025a4afac043fb5258d15b9caf (diff)
Improve examples CMakeLists.txt
- Remove "# generated from xyz.pro" comment from pro2cmake - Remove automatic use of CMAKE_AUTORCC - Only opt into CMAKE_AUTOUIC if .ui files are involved - Remove explicit setting of CMAKE_INCLUDE_CURRENT_DIR - Combine multiple find_package(Qt6 ... calls) - use REQUIRED COMPONENTS - sort components alphabetically - Fix wrong indentations - Use (only) one empty line after multi-line commands Pick-to: 6.3 Change-Id: I03507e56c961cfd6ae138473437dfafe478d3233 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'examples/websockets/qmlwebsocketclient/CMakeLists.txt')
-rw-r--r--examples/websockets/qmlwebsocketclient/CMakeLists.txt16
1 files changed, 4 insertions, 12 deletions
diff --git a/examples/websockets/qmlwebsocketclient/CMakeLists.txt b/examples/websockets/qmlwebsocketclient/CMakeLists.txt
index 959dd90..7c99ae7 100644
--- a/examples/websockets/qmlwebsocketclient/CMakeLists.txt
+++ b/examples/websockets/qmlwebsocketclient/CMakeLists.txt
@@ -1,32 +1,25 @@
-# Generated from qmlwebsocketclient.pro.
-
cmake_minimum_required(VERSION 3.16)
project(qmlwebsocketclient LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/websockets/qmlwebsocketclient")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Quick)
-find_package(Qt6 COMPONENTS WebSockets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Quick WebSockets)
qt_add_executable(qmlwebsocketclient
main.cpp
)
+
set_target_properties(qmlwebsocketclient PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE FALSE
)
+
target_link_libraries(qmlwebsocketclient PUBLIC
Qt::Core
Qt::Gui
@@ -34,7 +27,6 @@ target_link_libraries(qmlwebsocketclient PUBLIC
Qt::WebSockets
)
-
# Resources:
set(data_resource_files
"qml/qmlwebsocketclient/main.qml"