summaryrefslogtreecommitdiffstats
path: root/examples/serialport/cwritersync
diff options
context:
space:
mode:
authorKarsten Heimrich <karsten.heimrich@qt.io>2021-01-11 15:49:30 +0100
committerKarsten Heimrich <karsten.heimrich@qt.io>2021-01-15 12:34:22 +0100
commit66918b6492297e7750621d85d4372bf45e81a86d (patch)
tree161146a97b8863432ddedb629b700f479189d4c8 /examples/serialport/cwritersync
parentbb26d975c157a70d93e42ddd2748f81440186cf5 (diff)
Qt6: Port module to cmake build system
Fixes: QTBUG-89767 Fixes: QTBUG-89878 Change-Id: I860ae7b9dbb0f79e9e952d594b9737d4c452579a Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'examples/serialport/cwritersync')
-rw-r--r--examples/serialport/cwritersync/CMakeLists.txt35
1 files changed, 35 insertions, 0 deletions
diff --git a/examples/serialport/cwritersync/CMakeLists.txt b/examples/serialport/cwritersync/CMakeLists.txt
new file mode 100644
index 00000000..a78140cb
--- /dev/null
+++ b/examples/serialport/cwritersync/CMakeLists.txt
@@ -0,0 +1,35 @@
+cmake_minimum_required(VERSION 3.14)
+project(cwritersync 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")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/serialport/cwritersync")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS SerialPort)
+
+qt_add_executable(cwritersync
+ main.cpp
+)
+set_target_properties(cwritersync PROPERTIES
+ WIN32_EXECUTABLE FALSE
+ MACOSX_BUNDLE FALSE
+)
+target_link_libraries(cwritersync PRIVATE
+ Qt::Core
+ Qt::SerialPort
+)
+
+install(TARGETS cwritersync
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)