diff options
Diffstat (limited to 'examples/network/torrent/CMakeLists.txt')
-rw-r--r-- | examples/network/torrent/CMakeLists.txt | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/examples/network/torrent/CMakeLists.txt b/examples/network/torrent/CMakeLists.txt index 4c175fe1df..fbf974efef 100644 --- a/examples/network/torrent/CMakeLists.txt +++ b/examples/network/torrent/CMakeLists.txt @@ -1,31 +1,19 @@ -# Generated from torrent.pro. +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause -cmake_minimum_required(VERSION 3.14) +cmake_minimum_required(VERSION 3.16) project(torrent LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Network Widgets) -set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) +qt_standard_project_setup() -if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") -endif() - -set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/network/torrent") - -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Network) -find_package(Qt6 COMPONENTS Widgets) - -add_qt_gui_executable(torrent +qt_add_executable(torrent addtorrentdialog.cpp addtorrentdialog.h + addtorrentform.ui bencodeparser.cpp bencodeparser.h connectionmanager.cpp connectionmanager.h filemanager.cpp filemanager.h - forms/addtorrentform.ui main.cpp mainwindow.cpp mainwindow.h metainfo.cpp metainfo.h @@ -35,28 +23,33 @@ add_qt_gui_executable(torrent torrentserver.cpp torrentserver.h trackerclient.cpp trackerclient.h ) -target_include_directories(torrent PUBLIC forms) # special case -target_link_libraries(torrent PUBLIC - Qt::Core - Qt::Gui - Qt::Network - Qt::Widgets + +set_target_properties(torrent PROPERTIES + WIN32_EXECUTABLE TRUE + MACOSX_BUNDLE TRUE ) +target_link_libraries(torrent PRIVATE + Qt6::Core + Qt6::Gui + Qt6::Network + Qt6::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" + "icons/1downarrow.svg" + "icons/1uparrow.svg" + "icons/bottom.svg" + "icons/exit.svg" + "icons/peertopeer.svg" + "icons/player_pause.svg" + "icons/player_play.svg" + "icons/player_stop.svg" + "icons/about.svg" ) -qt6_add_resources(torrent "icons" +qt_add_resources(torrent "icons" PREFIX "/" FILES @@ -64,7 +57,14 @@ qt6_add_resources(torrent "icons" ) install(TARGETS torrent - RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" - BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" - LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION . + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) + +qt_generate_deploy_app_script( + TARGET torrent + OUTPUT_SCRIPT deploy_script + NO_UNSUPPORTED_PLATFORM_ERROR ) +install(SCRIPT ${deploy_script}) |