1 add_executable(qBittorrent
12 target_include_directories(qBittorrent PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
13 target_link_libraries(qBittorrent
18 set_target_properties(qBittorrent
26 include(QbtTranslations)
28 file(GLOB QBT_TS_FILES ../lang/*.ts)
29 qbt_add_translations(qBittorrent QRC_FILE "../lang/lang.qrc" TS_FILES ${QBT_TS_FILES})
32 file(GLOB QBT_WEBUI_TS_FILES ../webui/www/translations/*.ts)
33 qbt_add_translations(qBittorrent QRC_FILE "../webui/www/translations/webui_translations.qrc" TS_FILES ${QBT_WEBUI_TS_FILES})
38 ../searchengine/searchengine.qrc
41 # With AUTORCC rcc is ran by cmake before language files are generated,
42 # and thus we call rcc explicitly
43 qt5_add_resources(QBT_APP_RESOURCE_SOURCE ${QBT_APP_RESOURCES})
47 target_sources(qBittorrent PRIVATE ../qbittorrent_mingw.rc)
49 target_sources(qBittorrent PRIVATE ../qbittorrent.rc)
51 target_sources(qBittorrent PRIVATE ../qbittorrent.exe.manifest)
56 target_sources(qBittorrent PRIVATE stacktrace.h)
58 target_sources(qBittorrent PRIVATE stacktrace_win.h)
60 target_sources(qBittorrent PRIVATE stacktracedialog.h)
61 endif (Qt5Widgets_FOUND)
67 target_link_libraries(qBittorrent PRIVATE qbt_searchengine qbt_gui)
68 set_target_properties(qBittorrent
70 OUTPUT_NAME qbittorrent
73 else(Qt5Widgets_FOUND)
74 set_target_properties(qBittorrent
76 OUTPUT_NAME qbittorrent-nox
78 endif (Qt5Widgets_FOUND)
81 target_link_libraries(qBittorrent PRIVATE qbt_webui)
84 # we have to include resources into the bundle
86 set(OSX_RES_SRC_DIR "${qBittorrent_SOURCE_DIR}/dist/mac")
87 list(APPEND QBT_APP_RESOURCE_SOURCE
88 "${OSX_RES_SRC_DIR}/qt.conf"
89 "${OSX_RES_SRC_DIR}/qBitTorrentDocument.icns"
90 "${OSX_RES_SRC_DIR}/qbittorrent_mac.icns")
91 set_source_files_properties(
92 "${OSX_RES_SRC_DIR}/qt.conf"
93 "${OSX_RES_SRC_DIR}/qBitTorrentDocument.icns"
94 "${OSX_RES_SRC_DIR}/qbittorrent_mac.icns"
96 MACOSX_PACKAGE_LOCATION Resources)
97 set(QT_TR_DIR "${qBittorrent_SOURCE_DIR}/dist/qt-translations")
100 ${QT_TR_DIR}/qt_bg.qm
101 ${QT_TR_DIR}/qt_ca.qm
102 ${QT_TR_DIR}/qt_cs.qm
103 ${QT_TR_DIR}/qt_da.qm
104 ${QT_TR_DIR}/qt_de.qm
105 ${QT_TR_DIR}/qt_es.qm
106 ${QT_TR_DIR}/qt_eu.qm
107 ${QT_TR_DIR}/qt_fi.qm
108 ${QT_TR_DIR}/qt_fr.qm
109 ${QT_TR_DIR}/qt_gl.qm
110 ${QT_TR_DIR}/qt_he.qm
111 ${QT_TR_DIR}/qt_hu.qm
112 ${QT_TR_DIR}/qt_it.qm
113 ${QT_TR_DIR}/qt_ja.qm
114 ${QT_TR_DIR}/qt_ko.qm
115 ${QT_TR_DIR}/qt_lt.qm
116 ${QT_TR_DIR}/qt_nl.qm
117 ${QT_TR_DIR}/qt_pl.qm
118 ${QT_TR_DIR}/qt_pt.qm
119 ${QT_TR_DIR}/qt_pt_BR.qm
120 ${QT_TR_DIR}/qt_ru.qm
121 ${QT_TR_DIR}/qt_sk.qm
122 ${QT_TR_DIR}/qt_sv.qm
123 ${QT_TR_DIR}/qt_tr.qm
124 ${QT_TR_DIR}/qt_uk.qm
125 ${QT_TR_DIR}/qt_zh_CN.qm
126 ${QT_TR_DIR}/qt_zh_TW.qm
128 list(APPEND QBT_APP_RESOURCE_SOURCE ${QT_TRANSLATIONS})
129 set_source_files_properties(${QT_TRANSLATIONS}
130 PROPERTIES MACOSX_PACKAGE_LOCATION translations)
133 target_sources(qBittorrent PRIVATE ${QBT_QM_FILES} ${QBT_APP_RESOURCE_SOURCE})
135 get_target_property(QBT_EXECUTABLE_NAME qBittorrent OUTPUT_NAME)
137 target_link_libraries(qBittorrent PRIVATE ${QBT_TARGET_LIBRARIES} QtSingleApplication::QtSingleApplication)
140 set(qbt_BUNDLE_NAME ${QBT_EXECUTABLE_NAME})
142 # substitute @EXECUTABLE@ in dist/mac/Info.plist
143 set(EXECUTABLE ${qbt_BUNDLE_NAME})
144 configure_file(${qBittorrent_SOURCE_DIR}/dist/mac/Info.plist ${qBittorrent_BINARY_DIR}/dist/mac/Info.plist @ONLY)
146 set_target_properties(qBittorrent PROPERTIES
147 MACOSX_BUNDLE_BUNDLE_NAME "${qbt_BUNDLE_NAME}"
148 MACOSX_BUNDLE_INFO_PLIST ${qBittorrent_BINARY_DIR}/dist/mac/Info.plist
153 install(TARGETS qBittorrent
154 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
158 if (Qt5Widgets_FOUND AND APPLE)
159 find_package(Qt5Svg REQUIRED)
161 endif (Qt5Widgets_FOUND AND APPLE)