source: trunk/qt/CMakeLists.txt @ 14387

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

Rework torrent details dialog in Qt client to load from .ui

Make squeeze labels (used for values on Information tab) display tooltip
on hover if their text doesn't fit. Make selective labels (same as in
GTK+ client) text selectable with keyboard in addition to mouse.
Prevent dialog width growth occured before to fit long error texts.

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    triconpushbutton.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    triconpushbutton.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)
107
108tr_qt_add_resources(${PROJECT_NAME}_QRC_SOURCES
109    application.qrc
110)
111
112set(${PROJECT_NAME}_LINGUAS
113    en
114    es
115    eu
116    fr
117    hu
118    kk
119    lt
120    pt_BR
121    ru
122    uk
123)
124
125if(ENABLE_NLS)
126    set(${PROJECT_NAME}_ENABLED_LINGUAS ${${PROJECT_NAME}_LINGUAS})
127else()
128    set(${PROJECT_NAME}_ENABLED_LINGUAS)
129endif()
130
131set(${PROJECT_NAME}_TS_FILES)
132foreach(LANG ${${PROJECT_NAME}_ENABLED_LINGUAS})
133    list(APPEND ${PROJECT_NAME}_TS_FILES translations/transmission_${LANG}.ts)
134endforeach()
135
136if(${PROJECT_NAME}_TS_FILES)
137    tr_qt_add_translation(${PROJECT_NAME}_QM_FILES ${${PROJECT_NAME}_TS_FILES})
138endif()
139
140include_directories(
141    ${CMAKE_SOURCE_DIR}
142    ${PROJECT_SOURCE_DIR}
143    ${PROJECT_BINARY_DIR}
144    ${CURL_INCLUDE_DIRS}
145    ${EVENT2_INCLUDE_DIRS}
146)
147
148add_executable(${TR_NAME}-qt
149    ${${PROJECT_NAME}_SOURCES}
150    ${${PROJECT_NAME}_UI_SOURCES}
151    ${${PROJECT_NAME}_QRC_SOURCES}
152    ${${PROJECT_NAME}_HEADERS}
153    ${${PROJECT_NAME}_QM_FILES}
154)
155
156target_link_libraries(${TR_NAME}-qt
157    ${TR_NAME}
158    ${QT_LIBRARIES}
159    ${CURL_LIBRARIES}
160    ${EVENT2_LIBRARIES}
161)
162
163if(USE_QT5)
164    qt5_use_modules(${TR_NAME}-qt ${TR_QT5_MODULES})
165endif()
166
167set_target_properties(${TR_NAME}-qt PROPERTIES AUTOMOC TRUE)
168
169install(TARGETS ${TR_NAME}-qt DESTINATION ${CMAKE_INSTALL_BINDIR})
170
171if(INSTALL_DOC)
172    install(FILES ${TR_NAME}-qt.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
173endif()
174
175install(FILES transmission-qt.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
Note: See TracBrowser for help on using the repository browser.