aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorIvan Solovev <ivan.solovev@qt.io>2023-06-14 13:19:54 +0200
committerIvan Solovev <ivan.solovev@qt.io>2023-06-21 10:31:01 +0200
commitb6e7a5770add4c183222541ed5043b8f218029be (patch)
tree719191f08b1696a05eaebf0813e9cc9c72b05208 /examples
parent423deb47684919d91040e399476703379065eb6b (diff)
CoAP Multicast Discovery example: clean-up build files
* Use qt_standard_project_setup() instead of manually enabling moc and uic (CMake only) * Use PRIVATE linking (CMake only) * Do not use C++11 config - we're on C++17 now (qmake only) * Remove the QT_DEPRECATED_WARNINGS definition - it has no effect since Qt 5.13 (both qmake and CMake) This commit is a preparation for using qml modules Task-number: QTBUG-113858 Pick-to: 6.6 6.5 Change-Id: I9bd07769514e26e54fd7ad5829dd6d0c1351be46 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/coap/quickmulticastclient/CMakeLists.txt20
-rw-r--r--examples/coap/quickmulticastclient/quickmulticastclient.pro15
2 files changed, 11 insertions, 24 deletions
diff --git a/examples/coap/quickmulticastclient/CMakeLists.txt b/examples/coap/quickmulticastclient/CMakeLists.txt
index 2cd8f97..76e90d0 100644
--- a/examples/coap/quickmulticastclient/CMakeLists.txt
+++ b/examples/coap/quickmulticastclient/CMakeLists.txt
@@ -4,8 +4,6 @@
cmake_minimum_required(VERSION 3.16)
project(quickmulticastclient LANGUAGES CXX)
-set(CMAKE_AUTOMOC ON)
-
if(NOT DEFINED INSTALL_EXAMPLESDIR)
set(INSTALL_EXAMPLESDIR "examples")
endif()
@@ -14,6 +12,8 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/coap/quickmulticastclient")
find_package(Qt6 REQUIRED COMPONENTS Coap Core Gui Qml Quick)
+qt_standard_project_setup()
+
qt_add_executable(quickmulticastclient
main.cpp
qmlcoapmulticastclient.cpp qmlcoapmulticastclient.h
@@ -24,16 +24,12 @@ set_target_properties(quickmulticastclient PROPERTIES
MACOSX_BUNDLE TRUE
)
-target_compile_definitions(quickmulticastclient PUBLIC
- QT_DEPRECATED_WARNINGS
-)
-
-target_link_libraries(quickmulticastclient PUBLIC
- Qt::Coap
- Qt::Core
- Qt::Gui
- Qt::Qml
- Qt::Quick
+target_link_libraries(quickmulticastclient PRIVATE
+ Qt6::Coap
+ Qt6::Core
+ Qt6::Gui
+ Qt6::Qml
+ Qt6::Quick
)
# Resources:
diff --git a/examples/coap/quickmulticastclient/quickmulticastclient.pro b/examples/coap/quickmulticastclient/quickmulticastclient.pro
index e1e4558..6ac4c76 100644
--- a/examples/coap/quickmulticastclient/quickmulticastclient.pro
+++ b/examples/coap/quickmulticastclient/quickmulticastclient.pro
@@ -1,24 +1,15 @@
TEMPLATE = app
QT += qml quick coap
-CONFIG += c++11
-
-DEFINES += QT_DEPRECATED_WARNINGS
SOURCES += \
main.cpp \
qmlcoapmulticastclient.cpp
-RESOURCES += qml.qrc
-
-# Additional import path used to resolve QML modules in Qt Creator's code model
-QML_IMPORT_PATH =
+HEADERS += \
+ qmlcoapmulticastclient.h
-# Additional import path used to resolve QML modules just for Qt Quick Designer
-QML_DESIGNER_IMPORT_PATH =
+RESOURCES += qml.qrc
target.path = $$[QT_INSTALL_EXAMPLES]/coap/quickmulticastclient
INSTALLS += target
-
-HEADERS += \
- qmlcoapmulticastclient.h