source: trunk/qt/CMakeLists.txt @ 14616

Last change on this file since 14616 was 14616, checked in by mikedld, 7 years ago

Sync translations with Transifex

New translations: Italian (Italy) and Korean.

File size: 4.7 KB
Line 
1project(trqt)
2
3if(USE_QT5)
4    macro(tr_qt_wrap_ui)
5        qt5_wrap_ui(${ARGN})
6    endmacro()
7    macro(tr_qt_add_resources)
8        qt5_add_resources(${ARGN})
9    endmacro()
10    macro(tr_qt_add_translation)
11        qt5_add_translation(${ARGN})
12    endmacro()
13else()
14    include(${QT_USE_FILE})
15
16    macro(tr_qt_wrap_ui)
17        qt4_wrap_ui(${ARGN})
18    endmacro()
19    macro(tr_qt_add_resources)
20        qt4_add_resources(${ARGN})
21    endmacro()
22    macro(tr_qt_add_translation)
23        qt4_add_translation(${ARGN})
24    endmacro()
25endif()
26
27set(${PROJECT_NAME}_SOURCES
28    AboutDialog.cc
29    AddData.cc
30    Application.cc
31    ColumnResizer.cc
32    DBusAdaptor.cc
33    DetailsDialog.cc
34    FaviconCache.cc
35    FileTreeDelegate.cc
36    FileTreeItem.cc
37    FileTreeModel.cc
38    FileTreeView.cc
39    FilterBar.cc
40    FilterBarComboBox.cc
41    FilterBarComboBoxDelegate.cc
42    FilterBarLineEdit.cc
43    Filters.cc
44    Formatter.cc
45    FreeSpaceLabel.cc
46    IconToolButton.cc
47    LicenseDialog.cc
48    MainWindow.cc
49    MakeDialog.cc
50    OptionsDialog.cc
51    PathButton.cc
52    Prefs.cc
53    PrefsDialog.cc
54    RelocateDialog.cc
55    RpcClient.cc
56    Session.cc
57    SessionDialog.cc
58    SqueezeLabel.cc
59    StatsDialog.cc
60    Torrent.cc
61    TorrentDelegate.cc
62    TorrentDelegateMin.cc
63    TorrentFilter.cc
64    TorrentModel.cc
65    TorrentView.cc
66    TrackerDelegate.cc
67    TrackerModel.cc
68    TrackerModelFilter.cc
69    Utils.cc
70    WatchDir.cc
71)
72
73set(${PROJECT_NAME}_HEADERS
74    AboutDialog.h
75    AddData.h
76    Application.h
77    BaseDialog.h
78    ColumnResizer.h
79    CustomVariantType.h
80    DBusAdaptor.h
81    DetailsDialog.h
82    FaviconCache.h
83    FileTreeDelegate.h
84    FileTreeItem.h
85    FileTreeModel.h
86    FileTreeView.h
87    FilterBar.h
88    FilterBarComboBox.h
89    FilterBarComboBoxDelegate.h
90    FilterBarLineEdit.h
91    Filters.h
92    Formatter.h
93    FreeSpaceLabel.h
94    IconToolButton.h
95    LicenseDialog.h
96    MainWindow.h
97    MakeDialog.h
98    OptionsDialog.h
99    PathButton.h
100    Prefs.h
101    PrefsDialog.h
102    RelocateDialog.h
103    RpcClient.h
104    Session.h
105    SessionDialog.h
106    Speed.h
107    SqueezeLabel.h
108    StatsDialog.h
109    Torrent.h
110    TorrentDelegate.h
111    TorrentDelegateMin.h
112    TorrentFilter.h
113    TorrentModel.h
114    TorrentView.h
115    TrackerDelegate.h
116    TrackerModel.h
117    TrackerModelFilter.h
118    Utils.h
119    WatchDir.h
120)
121
122tr_qt_wrap_ui(${PROJECT_NAME}_UI_SOURCES
123    AboutDialog.ui
124    DetailsDialog.ui
125    LicenseDialog.ui
126    MainWindow.ui
127    MakeDialog.ui
128    MakeProgressDialog.ui
129    OptionsDialog.ui
130    PrefsDialog.ui
131    RelocateDialog.ui
132    SessionDialog.ui
133    StatsDialog.ui
134)
135
136set(${PROJECT_NAME}_QRC_FILES application.qrc)
137if(WIN32 OR APPLE)
138    list(APPEND ${PROJECT_NAME}_QRC_FILES icons/Faenza/Faenza.qrc)
139endif()
140
141tr_qt_add_resources(${PROJECT_NAME}_QRC_SOURCES ${${PROJECT_NAME}_QRC_FILES})
142
143set(${PROJECT_NAME}_LINGUAS
144    de
145    en
146    es
147    eu
148    fr
149    hu
150    id
151    it_IT
152    kk
153    ko
154    lt
155    pl_PL
156    pt_BR
157    ru
158    uk
159    zh_CN
160)
161
162if(ENABLE_NLS)
163    set(${PROJECT_NAME}_ENABLED_LINGUAS ${${PROJECT_NAME}_LINGUAS})
164else()
165    set(${PROJECT_NAME}_ENABLED_LINGUAS)
166endif()
167
168set(${PROJECT_NAME}_TS_FILES)
169foreach(LANG ${${PROJECT_NAME}_ENABLED_LINGUAS})
170    list(APPEND ${PROJECT_NAME}_TS_FILES translations/transmission_${LANG}.ts)
171endforeach()
172
173if(${PROJECT_NAME}_TS_FILES)
174    tr_qt_add_translation(${PROJECT_NAME}_QM_FILES ${${PROJECT_NAME}_TS_FILES})
175endif()
176
177include_directories(
178    ${CMAKE_SOURCE_DIR}
179    ${PROJECT_SOURCE_DIR}
180    ${PROJECT_BINARY_DIR}
181    ${CURL_INCLUDE_DIRS}
182    ${EVENT2_INCLUDE_DIRS}
183)
184
185add_definitions(
186    "-DTRANSLATIONS_DIR=\"${CMAKE_INSTALL_FULL_DATADIR}/${TR_NAME}/translations\""
187    -DQT_NO_CAST_FROM_ASCII
188)
189
190tr_win32_app_info(${PROJECT_NAME}_WIN32_RC_FILE
191    "Transmission Qt Client"
192    "transmission-qt"
193    "transmission-qt.exe"
194    "qtr.ico")
195
196add_executable(${TR_NAME}-qt WIN32
197    ${${PROJECT_NAME}_SOURCES}
198    ${${PROJECT_NAME}_UI_SOURCES}
199    ${${PROJECT_NAME}_QRC_SOURCES}
200    ${${PROJECT_NAME}_HEADERS}
201    ${${PROJECT_NAME}_QM_FILES}
202    ${${PROJECT_NAME}_WIN32_RC_FILE}
203)
204
205target_link_libraries(${TR_NAME}-qt
206    ${TR_NAME}
207    ${QT_LIBRARIES}
208    ${CURL_LIBRARIES}
209    ${EVENT2_LIBRARIES}
210)
211
212if(MSVC)
213    tr_append_target_property(${TR_NAME}-qt LINK_FLAGS "/ENTRY:mainCRTStartup")
214endif()
215
216if(USE_QT5)
217    qt5_use_modules(${TR_NAME}-qt ${TR_QT5_MODULES})
218endif()
219
220set_target_properties(${TR_NAME}-qt PROPERTIES AUTOMOC TRUE)
221
222install(TARGETS ${TR_NAME}-qt DESTINATION ${CMAKE_INSTALL_BINDIR})
223
224if(INSTALL_DOC)
225    install(FILES ${TR_NAME}-qt.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
226endif()
227
228install(FILES transmission-qt.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
229
230if(ENABLE_NLS)
231    install(FILES ${${PROJECT_NAME}_QM_FILES} DESTINATION ${CMAKE_INSTALL_DATADIR}/${TR_NAME}/translations)
232endif()
Note: See TracBrowser for help on using the repository browser.