2018-06-05 04:03:38 +03:00
|
|
|
add_executable(qBittorrent
|
2015-11-06 21:03:18 +03:00
|
|
|
application.h
|
2017-05-07 14:40:33 +03:00
|
|
|
cmdoptions.h
|
2016-03-28 20:44:59 +03:00
|
|
|
filelogger.h
|
2018-06-05 04:03:38 +03:00
|
|
|
upgrade.h
|
2015-11-06 21:03:18 +03:00
|
|
|
application.cpp
|
2017-05-07 14:40:33 +03:00
|
|
|
cmdoptions.cpp
|
2016-03-28 20:44:59 +03:00
|
|
|
filelogger.cpp
|
2015-11-06 21:03:18 +03:00
|
|
|
main.cpp
|
|
|
|
)
|
|
|
|
|
2018-06-05 04:03:38 +03:00
|
|
|
target_include_directories(qBittorrent PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
target_link_libraries(qBittorrent
|
|
|
|
PRIVATE
|
|
|
|
qbt_base
|
|
|
|
)
|
|
|
|
|
|
|
|
set_target_properties(qBittorrent
|
|
|
|
PROPERTIES
|
|
|
|
AUTOUIC True
|
|
|
|
AUTORCC True
|
|
|
|
MACOSX_BUNDLE True
|
|
|
|
)
|
|
|
|
|
2015-11-06 21:03:18 +03:00
|
|
|
# translations
|
2018-10-13 21:11:14 +03:00
|
|
|
include(QbtTranslations)
|
2015-11-06 21:03:18 +03:00
|
|
|
|
2018-10-13 21:11:14 +03:00
|
|
|
file(GLOB QBT_TS_FILES ../lang/*.ts)
|
|
|
|
qbt_add_translations(qBittorrent QRC_FILE "../lang/lang.qrc" TS_FILES ${QBT_TS_FILES})
|
2015-11-06 21:03:18 +03:00
|
|
|
|
2018-10-13 21:11:14 +03:00
|
|
|
if (WEBUI)
|
|
|
|
file(GLOB QBT_WEBUI_TS_FILES ../webui/www/translations/*.ts)
|
|
|
|
qbt_add_translations(qBittorrent QRC_FILE "../webui/www/translations/webui_translations.qrc" TS_FILES ${QBT_WEBUI_TS_FILES})
|
|
|
|
endif()
|
2015-11-06 21:03:18 +03:00
|
|
|
|
|
|
|
set(QBT_APP_RESOURCES
|
2018-06-11 12:11:07 +03:00
|
|
|
../icons/icons.qrc
|
|
|
|
../searchengine/searchengine.qrc
|
2015-11-06 21:03:18 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
# With AUTORCC rcc is ran by cmake before language files are generated,
|
|
|
|
# and thus we call rcc explicitly
|
2017-03-15 16:20:28 +03:00
|
|
|
qt5_add_resources(QBT_APP_RESOURCE_SOURCE ${QBT_APP_RESOURCES})
|
2015-11-06 21:03:18 +03:00
|
|
|
|
|
|
|
if (WIN32)
|
|
|
|
if (MINGW)
|
2018-06-05 04:03:38 +03:00
|
|
|
target_sources(qBittorrent PRIVATE ../qbittorrent_mingw.rc)
|
2015-11-06 21:03:18 +03:00
|
|
|
else (MINGW)
|
2018-06-05 04:03:38 +03:00
|
|
|
target_sources(qBittorrent PRIVATE ../qbittorrent.rc)
|
2015-11-06 21:03:18 +03:00
|
|
|
endif (MINGW)
|
2018-06-05 04:03:38 +03:00
|
|
|
target_sources(qBittorrent PRIVATE ../qbittorrent.exe.manifest)
|
2015-11-06 21:03:18 +03:00
|
|
|
endif (WIN32)
|
|
|
|
|
2018-04-09 23:30:20 +03:00
|
|
|
if (STACKTRACE)
|
|
|
|
if (UNIX)
|
2018-06-05 04:03:38 +03:00
|
|
|
target_sources(qBittorrent PRIVATE stacktrace.h)
|
2018-04-09 23:30:20 +03:00
|
|
|
else (UNIX)
|
2018-06-05 04:03:38 +03:00
|
|
|
target_sources(qBittorrent PRIVATE stacktrace_win.h)
|
|
|
|
if (Qt5Widgets_FOUND)
|
2018-06-14 12:54:23 +03:00
|
|
|
target_sources(qBittorrent PRIVATE stacktracedialog.h)
|
2018-06-05 04:03:38 +03:00
|
|
|
endif (Qt5Widgets_FOUND)
|
2018-04-09 23:30:20 +03:00
|
|
|
endif (UNIX)
|
|
|
|
endif (STACKTRACE)
|
2015-11-06 21:03:18 +03:00
|
|
|
|
2018-06-05 04:03:38 +03:00
|
|
|
|
|
|
|
if (Qt5Widgets_FOUND)
|
|
|
|
target_link_libraries(qBittorrent PRIVATE qbt_searchengine qbt_gui)
|
|
|
|
set_target_properties(qBittorrent
|
|
|
|
PROPERTIES
|
|
|
|
OUTPUT_NAME qbittorrent
|
|
|
|
WIN32_EXECUTABLE True
|
2015-11-06 21:03:18 +03:00
|
|
|
)
|
2018-06-05 04:03:38 +03:00
|
|
|
else(Qt5Widgets_FOUND)
|
|
|
|
set_target_properties(qBittorrent
|
|
|
|
PROPERTIES
|
|
|
|
OUTPUT_NAME qbittorrent-nox
|
|
|
|
)
|
|
|
|
endif (Qt5Widgets_FOUND)
|
2015-11-06 21:03:18 +03:00
|
|
|
|
|
|
|
if (WEBUI)
|
2018-06-05 04:03:38 +03:00
|
|
|
target_link_libraries(qBittorrent PRIVATE qbt_webui)
|
2015-11-06 21:03:18 +03:00
|
|
|
endif (WEBUI)
|
|
|
|
|
2016-03-12 05:49:34 +03:00
|
|
|
# we have to include resources into the bundle
|
|
|
|
if (APPLE)
|
|
|
|
set(OSX_RES_SRC_DIR "${qBittorrent_SOURCE_DIR}/dist/mac")
|
|
|
|
list(APPEND QBT_APP_RESOURCE_SOURCE
|
|
|
|
"${OSX_RES_SRC_DIR}/qt.conf"
|
|
|
|
"${OSX_RES_SRC_DIR}/qBitTorrentDocument.icns"
|
|
|
|
"${OSX_RES_SRC_DIR}/qbittorrent_mac.icns")
|
|
|
|
set_source_files_properties(
|
|
|
|
"${OSX_RES_SRC_DIR}/qt.conf"
|
|
|
|
"${OSX_RES_SRC_DIR}/qBitTorrentDocument.icns"
|
|
|
|
"${OSX_RES_SRC_DIR}/qbittorrent_mac.icns"
|
|
|
|
PROPERTIES
|
|
|
|
MACOSX_PACKAGE_LOCATION Resources)
|
|
|
|
set(QT_TR_DIR "${qBittorrent_SOURCE_DIR}/dist/qt-translations")
|
|
|
|
set(QT_TRANSLATIONS
|
|
|
|
${QT_TR_DIR}/qt_ar.qm
|
|
|
|
${QT_TR_DIR}/qt_bg.qm
|
|
|
|
${QT_TR_DIR}/qt_ca.qm
|
|
|
|
${QT_TR_DIR}/qt_cs.qm
|
|
|
|
${QT_TR_DIR}/qt_da.qm
|
|
|
|
${QT_TR_DIR}/qt_de.qm
|
|
|
|
${QT_TR_DIR}/qt_es.qm
|
|
|
|
${QT_TR_DIR}/qt_eu.qm
|
|
|
|
${QT_TR_DIR}/qt_fi.qm
|
|
|
|
${QT_TR_DIR}/qt_fr.qm
|
|
|
|
${QT_TR_DIR}/qt_gl.qm
|
|
|
|
${QT_TR_DIR}/qt_he.qm
|
|
|
|
${QT_TR_DIR}/qt_hu.qm
|
|
|
|
${QT_TR_DIR}/qt_it.qm
|
|
|
|
${QT_TR_DIR}/qt_ja.qm
|
|
|
|
${QT_TR_DIR}/qt_ko.qm
|
|
|
|
${QT_TR_DIR}/qt_lt.qm
|
|
|
|
${QT_TR_DIR}/qt_nl.qm
|
|
|
|
${QT_TR_DIR}/qt_pl.qm
|
|
|
|
${QT_TR_DIR}/qt_pt.qm
|
|
|
|
${QT_TR_DIR}/qt_pt_BR.qm
|
|
|
|
${QT_TR_DIR}/qt_ru.qm
|
|
|
|
${QT_TR_DIR}/qt_sk.qm
|
|
|
|
${QT_TR_DIR}/qt_sv.qm
|
|
|
|
${QT_TR_DIR}/qt_tr.qm
|
|
|
|
${QT_TR_DIR}/qt_uk.qm
|
|
|
|
${QT_TR_DIR}/qt_zh_CN.qm
|
|
|
|
${QT_TR_DIR}/qt_zh_TW.qm
|
|
|
|
)
|
|
|
|
list(APPEND QBT_APP_RESOURCE_SOURCE ${QT_TRANSLATIONS})
|
|
|
|
set_source_files_properties(${QT_TRANSLATIONS}
|
|
|
|
PROPERTIES MACOSX_PACKAGE_LOCATION translations)
|
|
|
|
endif (APPLE)
|
|
|
|
|
2018-06-05 04:03:38 +03:00
|
|
|
target_sources(qBittorrent PRIVATE ${QBT_QM_FILES} ${QBT_APP_RESOURCE_SOURCE})
|
2015-11-06 21:03:18 +03:00
|
|
|
|
2017-07-14 10:45:57 +03:00
|
|
|
get_target_property(QBT_EXECUTABLE_NAME qBittorrent OUTPUT_NAME)
|
2015-11-06 21:03:18 +03:00
|
|
|
|
2018-06-05 04:03:38 +03:00
|
|
|
target_link_libraries(qBittorrent PRIVATE ${QBT_TARGET_LIBRARIES} QtSingleApplication::QtSingleApplication)
|
2015-11-06 21:03:18 +03:00
|
|
|
|
2016-03-12 05:49:34 +03:00
|
|
|
if (APPLE)
|
2017-07-14 10:45:57 +03:00
|
|
|
set(qbt_BUNDLE_NAME ${QBT_EXECUTABLE_NAME})
|
2016-12-20 10:03:48 +03:00
|
|
|
|
|
|
|
# substitute @EXECUTABLE@ in dist/mac/Info.plist
|
|
|
|
set(EXECUTABLE ${qbt_BUNDLE_NAME})
|
|
|
|
configure_file(${qBittorrent_SOURCE_DIR}/dist/mac/Info.plist ${qBittorrent_BINARY_DIR}/dist/mac/Info.plist @ONLY)
|
|
|
|
|
2017-07-14 10:45:57 +03:00
|
|
|
set_target_properties(qBittorrent PROPERTIES
|
2016-03-12 05:49:34 +03:00
|
|
|
MACOSX_BUNDLE_BUNDLE_NAME "${qbt_BUNDLE_NAME}"
|
2016-12-20 10:03:48 +03:00
|
|
|
MACOSX_BUNDLE_INFO_PLIST ${qBittorrent_BINARY_DIR}/dist/mac/Info.plist
|
2016-03-12 05:49:34 +03:00
|
|
|
)
|
|
|
|
endif (APPLE)
|
|
|
|
|
2015-11-06 21:03:18 +03:00
|
|
|
# installation
|
2017-07-14 10:45:57 +03:00
|
|
|
install(TARGETS qBittorrent
|
2016-03-12 05:49:34 +03:00
|
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
|
|
BUNDLE DESTINATION .
|
|
|
|
COMPONENT runtime)
|
|
|
|
|
2018-06-05 04:03:38 +03:00
|
|
|
if (Qt5Widgets_FOUND AND APPLE)
|
|
|
|
find_package(Qt5Svg REQUIRED)
|
2017-07-14 10:45:57 +03:00
|
|
|
include(bundle)
|
2018-06-05 04:03:38 +03:00
|
|
|
endif (Qt5Widgets_FOUND AND APPLE)
|