summaryrefslogtreecommitdiffstats
path: root/examples/network
diff options
context:
space:
mode:
Diffstat (limited to 'examples/network')
-rw-r--r--examples/network/bearermonitor/CMakeLists.txt8
-rw-r--r--examples/network/blockingfortuneclient/CMakeLists.txt6
-rw-r--r--examples/network/broadcastreceiver/CMakeLists.txt6
-rw-r--r--examples/network/broadcastsender/CMakeLists.txt6
-rw-r--r--examples/network/dnslookup/CMakeLists.txt2
-rw-r--r--examples/network/download/CMakeLists.txt2
-rw-r--r--examples/network/downloadmanager/CMakeLists.txt2
-rw-r--r--examples/network/fortuneclient/CMakeLists.txt6
-rw-r--r--examples/network/fortuneserver/CMakeLists.txt6
-rw-r--r--examples/network/googlesuggest/CMakeLists.txt6
-rw-r--r--examples/network/http/CMakeLists.txt6
-rw-r--r--examples/network/loopback/CMakeLists.txt6
-rw-r--r--examples/network/multicastreceiver/CMakeLists.txt6
-rw-r--r--examples/network/multicastsender/CMakeLists.txt6
-rw-r--r--examples/network/multistreamclient/CMakeLists.txt6
-rw-r--r--examples/network/multistreamserver/CMakeLists.txt6
-rw-r--r--examples/network/network-chat/CMakeLists.txt6
-rw-r--r--examples/network/securesocketclient/CMakeLists.txt20
-rw-r--r--examples/network/secureudpclient/CMakeLists.txt6
-rw-r--r--examples/network/secureudpserver/CMakeLists.txt6
-rw-r--r--examples/network/threadedfortuneserver/CMakeLists.txt6
-rw-r--r--examples/network/torrent/.prev_CMakeLists.txt28
-rw-r--r--examples/network/torrent/CMakeLists.txt27
23 files changed, 159 insertions, 26 deletions
diff --git a/examples/network/bearermonitor/CMakeLists.txt b/examples/network/bearermonitor/CMakeLists.txt
index eb992a0c58..4e8bfca813 100644
--- a/examples/network/bearermonitor/CMakeLists.txt
+++ b/examples/network/bearermonitor/CMakeLists.txt
@@ -9,7 +9,7 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples")
+set(INSTALL_EXAMPLEDIR "examples/network/bearermonitor")
find_package(Qt6 COMPONENTS Core)
find_package(Qt6 COMPONENTS Gui)
@@ -30,6 +30,12 @@ target_link_libraries(bearermonitor PUBLIC
Qt::Widgets
)
+if(WIN32)
+ target_link_libraries(bearermonitor PUBLIC
+ ws2_32
+ )
+endif()
+
install(TARGETS bearermonitor
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
diff --git a/examples/network/blockingfortuneclient/CMakeLists.txt b/examples/network/blockingfortuneclient/CMakeLists.txt
index 14e15f9e13..d2c79bbcd2 100644
--- a/examples/network/blockingfortuneclient/CMakeLists.txt
+++ b/examples/network/blockingfortuneclient/CMakeLists.txt
@@ -9,8 +9,10 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples")
+set(INSTALL_EXAMPLEDIR "examples/network/blockingfortuneclient")
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Network)
find_package(Qt6 COMPONENTS Widgets)
@@ -20,6 +22,8 @@ add_qt_gui_executable(blockingfortuneclient
main.cpp
)
target_link_libraries(blockingfortuneclient PUBLIC
+ Qt::Core
+ Qt::Gui
Qt::Network
Qt::Widgets
)
diff --git a/examples/network/broadcastreceiver/CMakeLists.txt b/examples/network/broadcastreceiver/CMakeLists.txt
index ad1f9823d4..ea057a647b 100644
--- a/examples/network/broadcastreceiver/CMakeLists.txt
+++ b/examples/network/broadcastreceiver/CMakeLists.txt
@@ -9,8 +9,10 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples")
+set(INSTALL_EXAMPLEDIR "examples/network/broadcastreceiver")
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Network)
find_package(Qt6 COMPONENTS Widgets)
@@ -19,6 +21,8 @@ add_qt_gui_executable(broadcastreceiver
receiver.cpp receiver.h
)
target_link_libraries(broadcastreceiver PUBLIC
+ Qt::Core
+ Qt::Gui
Qt::Network
Qt::Widgets
)
diff --git a/examples/network/broadcastsender/CMakeLists.txt b/examples/network/broadcastsender/CMakeLists.txt
index b823046396..0a1885cfbb 100644
--- a/examples/network/broadcastsender/CMakeLists.txt
+++ b/examples/network/broadcastsender/CMakeLists.txt
@@ -9,8 +9,10 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples")
+set(INSTALL_EXAMPLEDIR "examples/network/broadcastsender")
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Network)
find_package(Qt6 COMPONENTS Widgets)
@@ -19,6 +21,8 @@ add_qt_gui_executable(broadcastsender
sender.cpp sender.h
)
target_link_libraries(broadcastsender PUBLIC
+ Qt::Core
+ Qt::Gui
Qt::Network
Qt::Widgets
)
diff --git a/examples/network/dnslookup/CMakeLists.txt b/examples/network/dnslookup/CMakeLists.txt
index bc0bb4d1eb..721d89179f 100644
--- a/examples/network/dnslookup/CMakeLists.txt
+++ b/examples/network/dnslookup/CMakeLists.txt
@@ -9,7 +9,7 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples")
+set(INSTALL_EXAMPLEDIR "examples/network/dnslookup")
find_package(Qt6 COMPONENTS Core)
find_package(Qt6 COMPONENTS Network)
diff --git a/examples/network/download/CMakeLists.txt b/examples/network/download/CMakeLists.txt
index 462bf30554..b4124fc8a3 100644
--- a/examples/network/download/CMakeLists.txt
+++ b/examples/network/download/CMakeLists.txt
@@ -9,7 +9,7 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples")
+set(INSTALL_EXAMPLEDIR "examples/network/download")
find_package(Qt6 COMPONENTS Core)
find_package(Qt6 COMPONENTS Network)
diff --git a/examples/network/downloadmanager/CMakeLists.txt b/examples/network/downloadmanager/CMakeLists.txt
index 09d1db51d0..8fc16bedb5 100644
--- a/examples/network/downloadmanager/CMakeLists.txt
+++ b/examples/network/downloadmanager/CMakeLists.txt
@@ -9,7 +9,7 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples")
+set(INSTALL_EXAMPLEDIR "examples/network/downloadmanager")
find_package(Qt6 COMPONENTS Core)
find_package(Qt6 COMPONENTS Network)
diff --git a/examples/network/fortuneclient/CMakeLists.txt b/examples/network/fortuneclient/CMakeLists.txt
index 7af88e9626..d44e75b0ff 100644
--- a/examples/network/fortuneclient/CMakeLists.txt
+++ b/examples/network/fortuneclient/CMakeLists.txt
@@ -9,8 +9,10 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples")
+set(INSTALL_EXAMPLEDIR "examples/network/fortuneclient")
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Network)
find_package(Qt6 COMPONENTS Widgets)
@@ -19,6 +21,8 @@ add_qt_gui_executable(fortuneclient
main.cpp
)
target_link_libraries(fortuneclient PUBLIC
+ Qt::Core
+ Qt::Gui
Qt::Network
Qt::Widgets
)
diff --git a/examples/network/fortuneserver/CMakeLists.txt b/examples/network/fortuneserver/CMakeLists.txt
index 19897104e0..2bcb9f076a 100644
--- a/examples/network/fortuneserver/CMakeLists.txt
+++ b/examples/network/fortuneserver/CMakeLists.txt
@@ -9,8 +9,10 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples")
+set(INSTALL_EXAMPLEDIR "examples/network/fortuneserver")
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Network)
find_package(Qt6 COMPONENTS Widgets)
@@ -19,6 +21,8 @@ add_qt_gui_executable(fortuneserver
server.cpp server.h
)
target_link_libraries(fortuneserver PUBLIC
+ Qt::Core
+ Qt::Gui
Qt::Network
Qt::Widgets
)
diff --git a/examples/network/googlesuggest/CMakeLists.txt b/examples/network/googlesuggest/CMakeLists.txt
index 5a6a52ce33..247980601f 100644
--- a/examples/network/googlesuggest/CMakeLists.txt
+++ b/examples/network/googlesuggest/CMakeLists.txt
@@ -9,8 +9,10 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples")
+set(INSTALL_EXAMPLEDIR "examples/network/googlesuggest")
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Network)
find_package(Qt6 COMPONENTS Widgets)
@@ -20,6 +22,8 @@ add_qt_gui_executable(googlesuggest
searchbox.cpp searchbox.h
)
target_link_libraries(googlesuggest PUBLIC
+ Qt::Core
+ Qt::Gui
Qt::Network
Qt::Widgets
)
diff --git a/examples/network/http/CMakeLists.txt b/examples/network/http/CMakeLists.txt
index 2e00f20635..3ce82d63da 100644
--- a/examples/network/http/CMakeLists.txt
+++ b/examples/network/http/CMakeLists.txt
@@ -9,8 +9,10 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples")
+set(INSTALL_EXAMPLEDIR "examples/network/http")
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Network)
find_package(Qt6 COMPONENTS Widgets)
@@ -20,6 +22,8 @@ add_qt_gui_executable(http
main.cpp
)
target_link_libraries(http PUBLIC
+ Qt::Core
+ Qt::Gui
Qt::Network
Qt::Widgets
)
diff --git a/examples/network/loopback/CMakeLists.txt b/examples/network/loopback/CMakeLists.txt
index 233ff460e3..8d42284914 100644
--- a/examples/network/loopback/CMakeLists.txt
+++ b/examples/network/loopback/CMakeLists.txt
@@ -9,8 +9,10 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples")
+set(INSTALL_EXAMPLEDIR "examples/network/loopback")
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Network)
find_package(Qt6 COMPONENTS Widgets)
@@ -19,6 +21,8 @@ add_qt_gui_executable(loopback
main.cpp
)
target_link_libraries(loopback PUBLIC
+ Qt::Core
+ Qt::Gui
Qt::Network
Qt::Widgets
)
diff --git a/examples/network/multicastreceiver/CMakeLists.txt b/examples/network/multicastreceiver/CMakeLists.txt
index 8073c9fb7e..f45b1b0db2 100644
--- a/examples/network/multicastreceiver/CMakeLists.txt
+++ b/examples/network/multicastreceiver/CMakeLists.txt
@@ -9,8 +9,10 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples")
+set(INSTALL_EXAMPLEDIR "examples/network/multicastreceiver")
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Network)
find_package(Qt6 COMPONENTS Widgets)
@@ -19,6 +21,8 @@ add_qt_gui_executable(multicastreceiver
receiver.cpp receiver.h
)
target_link_libraries(multicastreceiver PUBLIC
+ Qt::Core
+ Qt::Gui
Qt::Network
Qt::Widgets
)
diff --git a/examples/network/multicastsender/CMakeLists.txt b/examples/network/multicastsender/CMakeLists.txt
index 062c942b35..5ebd7cb767 100644
--- a/examples/network/multicastsender/CMakeLists.txt
+++ b/examples/network/multicastsender/CMakeLists.txt
@@ -9,8 +9,10 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples")
+set(INSTALL_EXAMPLEDIR "examples/network/multicastsender")
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Network)
find_package(Qt6 COMPONENTS Widgets)
@@ -19,6 +21,8 @@ add_qt_gui_executable(multicastsender
sender.cpp sender.h
)
target_link_libraries(multicastsender PUBLIC
+ Qt::Core
+ Qt::Gui
Qt::Network
Qt::Widgets
)
diff --git a/examples/network/multistreamclient/CMakeLists.txt b/examples/network/multistreamclient/CMakeLists.txt
index 617e556cff..a4a4be05df 100644
--- a/examples/network/multistreamclient/CMakeLists.txt
+++ b/examples/network/multistreamclient/CMakeLists.txt
@@ -9,8 +9,10 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples")
+set(INSTALL_EXAMPLEDIR "examples/network/multistreamclient")
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Network)
find_package(Qt6 COMPONENTS Widgets)
@@ -23,6 +25,8 @@ add_qt_gui_executable(multistreamclient
timeconsumer.cpp timeconsumer.h
)
target_link_libraries(multistreamclient PUBLIC
+ Qt::Core
+ Qt::Gui
Qt::Network
Qt::Widgets
)
diff --git a/examples/network/multistreamserver/CMakeLists.txt b/examples/network/multistreamserver/CMakeLists.txt
index 3564e370d7..ee871d06fa 100644
--- a/examples/network/multistreamserver/CMakeLists.txt
+++ b/examples/network/multistreamserver/CMakeLists.txt
@@ -9,8 +9,10 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples")
+set(INSTALL_EXAMPLEDIR "examples/network/multistreamserver")
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Network)
find_package(Qt6 COMPONENTS Widgets)
@@ -23,6 +25,8 @@ add_qt_gui_executable(multistreamserver
timeprovider.cpp timeprovider.h
)
target_link_libraries(multistreamserver PUBLIC
+ Qt::Core
+ Qt::Gui
Qt::Network
Qt::Widgets
)
diff --git a/examples/network/network-chat/CMakeLists.txt b/examples/network/network-chat/CMakeLists.txt
index eb836df8c9..4bd4879beb 100644
--- a/examples/network/network-chat/CMakeLists.txt
+++ b/examples/network/network-chat/CMakeLists.txt
@@ -9,8 +9,10 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples")
+set(INSTALL_EXAMPLEDIR "examples/network/network-chat")
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Network)
find_package(Qt6 COMPONENTS Widgets)
@@ -23,6 +25,8 @@ add_qt_gui_executable(network-chat
server.cpp server.h
)
target_link_libraries(network-chat PUBLIC
+ Qt::Core
+ Qt::Gui
Qt::Network
Qt::Widgets
)
diff --git a/examples/network/securesocketclient/CMakeLists.txt b/examples/network/securesocketclient/CMakeLists.txt
index d83bd5f284..13cdeba66d 100644
--- a/examples/network/securesocketclient/CMakeLists.txt
+++ b/examples/network/securesocketclient/CMakeLists.txt
@@ -9,23 +9,39 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples")
+set(INSTALL_EXAMPLEDIR "examples/network/securesocketclient")
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Network)
find_package(Qt6 COMPONENTS Widgets)
add_qt_gui_executable(securesocketclient
certificateinfo.cpp certificateinfo.h certificateinfo.ui
main.cpp
- securesocketclient.qrc
sslclient.cpp sslclient.h sslclient.ui
sslerrors.ui
)
target_link_libraries(securesocketclient PUBLIC
+ Qt::Core
+ Qt::Gui
Qt::Network
Qt::Widgets
)
+
+# Resources:
+set(securesocketclient_resource_files
+ "encrypted.png"
+)
+
+qt6_add_resources(securesocketclient "securesocketclient"
+ PREFIX
+ "/"
+ FILES
+ ${securesocketclient_resource_files}
+)
+
install(TARGETS securesocketclient
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
diff --git a/examples/network/secureudpclient/CMakeLists.txt b/examples/network/secureudpclient/CMakeLists.txt
index 385918a61b..936d93524b 100644
--- a/examples/network/secureudpclient/CMakeLists.txt
+++ b/examples/network/secureudpclient/CMakeLists.txt
@@ -9,8 +9,10 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples")
+set(INSTALL_EXAMPLEDIR "examples/network/secureudpclient")
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Widgets)
find_package(Qt6 COMPONENTS Network)
@@ -21,6 +23,8 @@ add_qt_gui_executable(secureudpclient
mainwindow.cpp mainwindow.h mainwindow.ui
)
target_link_libraries(secureudpclient PUBLIC
+ Qt::Core
+ Qt::Gui
Qt::Network
Qt::Widgets
)
diff --git a/examples/network/secureudpserver/CMakeLists.txt b/examples/network/secureudpserver/CMakeLists.txt
index 28d01df849..70816aea6b 100644
--- a/examples/network/secureudpserver/CMakeLists.txt
+++ b/examples/network/secureudpserver/CMakeLists.txt
@@ -9,8 +9,10 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples")
+set(INSTALL_EXAMPLEDIR "examples/network/secureudpserver")
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Widgets)
find_package(Qt6 COMPONENTS Network)
@@ -21,6 +23,8 @@ add_qt_gui_executable(secureudpserver
server.cpp server.h
)
target_link_libraries(secureudpserver PUBLIC
+ Qt::Core
+ Qt::Gui
Qt::Network
Qt::Widgets
)
diff --git a/examples/network/threadedfortuneserver/CMakeLists.txt b/examples/network/threadedfortuneserver/CMakeLists.txt
index 35372da369..20463b1417 100644
--- a/examples/network/threadedfortuneserver/CMakeLists.txt
+++ b/examples/network/threadedfortuneserver/CMakeLists.txt
@@ -9,8 +9,10 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples")
+set(INSTALL_EXAMPLEDIR "examples/network/threadedfortuneserver")
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Network)
find_package(Qt6 COMPONENTS Widgets)
@@ -21,6 +23,8 @@ add_qt_gui_executable(threadedfortuneserver
main.cpp
)
target_link_libraries(threadedfortuneserver PUBLIC
+ Qt::Core
+ Qt::Gui
Qt::Network
Qt::Widgets
)
diff --git a/examples/network/torrent/.prev_CMakeLists.txt b/examples/network/torrent/.prev_CMakeLists.txt
index 8c294427f7..b3ff66a4b3 100644
--- a/examples/network/torrent/.prev_CMakeLists.txt
+++ b/examples/network/torrent/.prev_CMakeLists.txt
@@ -9,8 +9,10 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples")
+set(INSTALL_EXAMPLEDIR "examples/network/torrent")
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Network)
find_package(Qt6 COMPONENTS Widgets)
@@ -20,7 +22,6 @@ add_qt_gui_executable(torrent
connectionmanager.cpp connectionmanager.h
filemanager.cpp filemanager.h
forms/addtorrentform.ui
- icons.qrc
main.cpp
mainwindow.cpp mainwindow.h
metainfo.cpp metainfo.h
@@ -31,11 +32,34 @@ add_qt_gui_executable(torrent
trackerclient.cpp trackerclient.h
)
target_link_libraries(torrent PUBLIC
+ Qt::Core
+ Qt::Gui
Qt::Network
Qt::Widgets
)
+
+# Resources:
+set(icons_resource_files
+ "icons/1downarrow.png"
+ "icons/1uparrow.png"
+ "icons/bottom.png"
+ "icons/exit.png"
+ "icons/peertopeer.png"
+ "icons/player_pause.png"
+ "icons/player_play.png"
+ "icons/player_stop.png"
+)
+
+qt6_add_resources(torrent "icons"
+ PREFIX
+ "/"
+ FILES
+ ${icons_resource_files}
+)
+
install(TARGETS torrent
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)
diff --git a/examples/network/torrent/CMakeLists.txt b/examples/network/torrent/CMakeLists.txt
index 9398369064..34df6e0c63 100644
--- a/examples/network/torrent/CMakeLists.txt
+++ b/examples/network/torrent/CMakeLists.txt
@@ -9,8 +9,10 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples")
+set(INSTALL_EXAMPLEDIR "examples/network/torrent")
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Network)
find_package(Qt6 COMPONENTS Widgets)
@@ -20,7 +22,6 @@ add_qt_gui_executable(torrent
connectionmanager.cpp connectionmanager.h
filemanager.cpp filemanager.h
forms/addtorrentform.ui
- icons.qrc
main.cpp
mainwindow.cpp mainwindow.h
metainfo.cpp metainfo.h
@@ -32,10 +33,32 @@ add_qt_gui_executable(torrent
)
target_include_directories(torrent PUBLIC forms) # special case
target_link_libraries(torrent PUBLIC
+ Qt::Core
+ Qt::Gui
Qt::Network
Qt::Widgets
)
+
+# Resources:
+set(icons_resource_files
+ "icons/1downarrow.png"
+ "icons/1uparrow.png"
+ "icons/bottom.png"
+ "icons/exit.png"
+ "icons/peertopeer.png"
+ "icons/player_pause.png"
+ "icons/player_play.png"
+ "icons/player_stop.png"
+)
+
+qt6_add_resources(torrent "icons"
+ PREFIX
+ "/"
+ FILES
+ ${icons_resource_files}
+)
+
install(TARGETS torrent
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"