summaryrefslogtreecommitdiffstats
path: root/examples/network/fortuneclient/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'examples/network/fortuneclient/CMakeLists.txt')
-rw-r--r--examples/network/fortuneclient/CMakeLists.txt38
1 files changed, 25 insertions, 13 deletions
diff --git a/examples/network/fortuneclient/CMakeLists.txt b/examples/network/fortuneclient/CMakeLists.txt
index bbeecf9c64..a9e0e00c7e 100644
--- a/examples/network/fortuneclient/CMakeLists.txt
+++ b/examples/network/fortuneclient/CMakeLists.txt
@@ -1,17 +1,29 @@
# Generated from fortuneclient.pro.
-#####################################################################
-## fortuneclient Binary:
-#####################################################################
+cmake_minimum_required(VERSION 3.14)
+project(fortuneclient LANGUAGES CXX)
-add_qt_executable(fortuneclient
- GUI
- OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/fortuneclient"
- INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/fortuneclient"
- SOURCES
- client.cpp client.h
- main.cpp
- LIBRARIES
- Qt::Network
- Qt::Widgets
+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(fortuneclient WIN32 MACOSX_BUNDLE
+ client.cpp client.h
+ main.cpp
+)
+target_link_libraries(fortuneclient PUBLIC
+ Qt::Network
+ Qt::Widgets
+)
+
+install(TARGETS fortuneclient
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
)