source: trunk/qt/CMakeLists.txt @ 14391

Last change on this file since 14391 was 14391, checked in by mikedld, 8 years ago

Rework statistics dialog in Qt client to load from .ui

Fix "Started %n time(s)" phrase (remove space in "time (s)", add proper
English translation for numeric forms).

File size: 3.3 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    about.cc
29    add-data.cc
30    app.cc
31    dbus-adaptor.cc
32    details.cc
33    favicon.cc
34    file-tree.cc
35    filterbar.cc
36    filters.cc
37    formatter.cc
38    freespace-label.cc
39    hig.cc
40    license.cc
41    mainwin.cc
42    make-dialog.cc
43    options.cc
44    prefs-dialog.cc
45    prefs.cc
46    relocate.cc
47    session-dialog.cc
48    session.cc
49    squeezelabel.cc
50    stats-dialog.cc
51    torrent-delegate-min.cc
52    torrent-delegate.cc
53    torrent-filter.cc
54    torrent-model.cc
55    torrent.cc
56    tracker-delegate.cc
57    tracker-model-filter.cc
58    tracker-model.cc
59    tricontoolbutton.cc
60    utils.cc
61    watchdir.cc
62)
63
64set(${PROJECT_NAME}_HEADERS
65    about.h
66    add-data.h
67    app.h
68    dbus-adaptor.h
69    details.h
70    favicon.h
71    file-tree.h
72    filterbar.h
73    filters.h
74    formatter.h
75    freespace-label.h
76    hig.h
77    license.h
78    mainwin.h
79    make-dialog.h
80    options.h
81    prefs-dialog.h
82    prefs.h
83    relocate.h
84    session-dialog.h
85    session.h
86    speed.h
87    squeezelabel.h
88    stats-dialog.h
89    torrent-delegate-min.h
90    torrent-delegate.h
91    torrent-filter.h
92    torrent-model.h
93    torrent.h
94    tracker-delegate.h
95    tracker-model-filter.h
96    tracker-model.h
97    tricontoolbutton.h
98    types.h
99    utils.h
100    watchdir.h
101)
102
103tr_qt_wrap_ui(${PROJECT_NAME}_UI_SOURCES
104    details.ui
105    mainwin.ui
106    stats-dialog.ui
107)
108
109tr_qt_add_resources(${PROJECT_NAME}_QRC_SOURCES
110    application.qrc
111)
112
113set(${PROJECT_NAME}_LINGUAS
114    en
115    es
116    eu
117    fr
118    hu
119    kk
120    lt
121    pt_BR
122    ru
123    uk
124)
125
126if(ENABLE_NLS)
127    set(${PROJECT_NAME}_ENABLED_LINGUAS ${${PROJECT_NAME}_LINGUAS})
128else()
129    set(${PROJECT_NAME}_ENABLED_LINGUAS)
130endif()
131
132set(${PROJECT_NAME}_TS_FILES)
133foreach(LANG ${${PROJECT_NAME}_ENABLED_LINGUAS})
134    list(APPEND ${PROJECT_NAME}_TS_FILES translations/transmission_${LANG}.ts)
135endforeach()
136
137if(${PROJECT_NAME}_TS_FILES)
138    tr_qt_add_translation(${PROJECT_NAME}_QM_FILES ${${PROJECT_NAME}_TS_FILES})
139endif()
140
141include_directories(
142    ${CMAKE_SOURCE_DIR}
143    ${PROJECT_SOURCE_DIR}
144    ${PROJECT_BINARY_DIR}
145    ${CURL_INCLUDE_DIRS}
146    ${EVENT2_INCLUDE_DIRS}
147)
148
149add_executable(${TR_NAME}-qt
150    ${${PROJECT_NAME}_SOURCES}
151    ${${PROJECT_NAME}_UI_SOURCES}
152    ${${PROJECT_NAME}_QRC_SOURCES}
153    ${${PROJECT_NAME}_HEADERS}
154    ${${PROJECT_NAME}_QM_FILES}
155)
156
157target_link_libraries(${TR_NAME}-qt
158    ${TR_NAME}
159    ${QT_LIBRARIES}
160    ${CURL_LIBRARIES}
161    ${EVENT2_LIBRARIES}
162)
163
164if(USE_QT5)
165    qt5_use_modules(${TR_NAME}-qt ${TR_QT5_MODULES})
166endif()
167
168set_target_properties(${TR_NAME}-qt PROPERTIES AUTOMOC TRUE)
169
170install(TARGETS ${TR_NAME}-qt DESTINATION ${CMAKE_INSTALL_BINDIR})
171
172if(INSTALL_DOC)
173    install(FILES ${TR_NAME}-qt.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
174endif()
175
176install(FILES transmission-qt.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
Note: See TracBrowser for help on using the repository browser.