Prevent WebUI tables from being highlighted
[qBittorrent.git] / src / app / CMakeLists.txt
blob4079dfe934e1495c8bbac0120391f80ad1f2a436
1 add_executable(qBittorrent
2 application.h
3 cmdoptions.h
4 filelogger.h
5 upgrade.h
6 application.cpp
7 cmdoptions.cpp
8 filelogger.cpp
9 main.cpp
12 target_include_directories(qBittorrent PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
13 target_link_libraries(qBittorrent
14     PRIVATE
15         qbt_base
18 set_target_properties(qBittorrent
19     PROPERTIES
20         AUTOUIC True
21         AUTORCC True
22         MACOSX_BUNDLE True
25 # translations
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})
31 if (WEBUI)
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})
34 endif()
36 set(QBT_APP_RESOURCES
37 ../icons/icons.qrc
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})
45 if (WIN32)
46     if (MINGW)
47         target_sources(qBittorrent PRIVATE ../qbittorrent_mingw.rc)
48     else (MINGW)
49         target_sources(qBittorrent PRIVATE ../qbittorrent.rc)
50     endif (MINGW)
51     target_sources(qBittorrent PRIVATE ../qbittorrent.exe.manifest)
52 endif (WIN32)
54 if (STACKTRACE)
55     if (UNIX)
56         target_sources(qBittorrent PRIVATE stacktrace.h)
57     else (UNIX)
58         target_sources(qBittorrent PRIVATE stacktrace_win.h)
59         if (Qt5Widgets_FOUND)
60             target_sources(qBittorrent PRIVATE stacktracedialog.h)
61         endif (Qt5Widgets_FOUND)
62     endif (UNIX)
63 endif (STACKTRACE)
66 if (Qt5Widgets_FOUND)
67     target_link_libraries(qBittorrent PRIVATE qbt_searchengine qbt_gui)
68     set_target_properties(qBittorrent
69         PROPERTIES
70             OUTPUT_NAME qbittorrent
71             WIN32_EXECUTABLE True
72     )
73 else(Qt5Widgets_FOUND)
74     set_target_properties(qBittorrent
75         PROPERTIES
76             OUTPUT_NAME qbittorrent-nox
77     )
78 endif (Qt5Widgets_FOUND)
80 if (WEBUI)
81     target_link_libraries(qBittorrent PRIVATE qbt_webui)
82 endif (WEBUI)
84 # we have to include resources into the bundle
85 if (APPLE)
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"
95         PROPERTIES
96             MACOSX_PACKAGE_LOCATION Resources)
97     set(QT_TR_DIR "${qBittorrent_SOURCE_DIR}/dist/qt-translations")
98     set(QT_TRANSLATIONS
99         ${QT_TR_DIR}/qt_ar.qm
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
127     )
128     list(APPEND QBT_APP_RESOURCE_SOURCE ${QT_TRANSLATIONS})
129     set_source_files_properties(${QT_TRANSLATIONS}
130         PROPERTIES MACOSX_PACKAGE_LOCATION translations)
131 endif (APPLE)
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)
139 if (APPLE)
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
149     )
150 endif (APPLE)
152 # installation
153 install(TARGETS qBittorrent
154     RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
155     BUNDLE  DESTINATION .
156     COMPONENT runtime)
158 if (Qt5Widgets_FOUND AND APPLE)
159     find_package(Qt5Svg REQUIRED)
160     include(bundle)
161 endif (Qt5Widgets_FOUND AND APPLE)