summaryrefslogtreecommitdiffstats
path: root/examples/network/network-chat/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'examples/network/network-chat/CMakeLists.txt')
-rw-r--r--examples/network/network-chat/CMakeLists.txt48
1 files changed, 29 insertions, 19 deletions
diff --git a/examples/network/network-chat/CMakeLists.txt b/examples/network/network-chat/CMakeLists.txt
index d620d899d1..a4fb950370 100644
--- a/examples/network/network-chat/CMakeLists.txt
+++ b/examples/network/network-chat/CMakeLists.txt
@@ -1,23 +1,33 @@
# Generated from network-chat.pro.
-#####################################################################
-## network-chat Binary:
-#####################################################################
+cmake_minimum_required(VERSION 3.14)
+project(network-chat LANGUAGES CXX)
-add_qt_executable(network-chat
- GUI
- OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/network-chat"
- INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/network-chat"
- SOURCES
- chatdialog.cpp chatdialog.h chatdialog.ui
- client.cpp client.h
- connection.cpp connection.h
- main.cpp
- peermanager.cpp peermanager.h
- server.cpp server.h
- PUBLIC_LIBRARIES
- Qt::Network
- Qt::Widgets
- ENABLE_AUTOGEN_TOOLS
- uic
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples")
+
+find_package(Qt5 COMPONENTS Network)
+find_package(Qt5 COMPONENTS Widgets)
+
+add_executable(network-chat WIN32 MACOSX_BUNDLE
+ chatdialog.cpp chatdialog.h chatdialog.ui
+ client.cpp client.h
+ connection.cpp connection.h
+ main.cpp
+ peermanager.cpp peermanager.h
+ server.cpp server.h
+)
+target_link_libraries(network-chat PUBLIC
+ Qt::Network
+ Qt::Widgets
+)
+
+install(TARGETS network-chat
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
)