2014-12-01 19:55:22 +00:00
|
|
|
project(trqt)
|
|
|
|
|
|
|
|
if(USE_QT5)
|
|
|
|
macro(tr_qt_wrap_ui)
|
|
|
|
qt5_wrap_ui(${ARGN})
|
|
|
|
endmacro()
|
|
|
|
macro(tr_qt_add_resources)
|
|
|
|
qt5_add_resources(${ARGN})
|
|
|
|
endmacro()
|
|
|
|
macro(tr_qt_add_translation)
|
|
|
|
qt5_add_translation(${ARGN})
|
|
|
|
endmacro()
|
|
|
|
else()
|
|
|
|
include(${QT_USE_FILE})
|
|
|
|
|
|
|
|
macro(tr_qt_wrap_ui)
|
|
|
|
qt4_wrap_ui(${ARGN})
|
|
|
|
endmacro()
|
|
|
|
macro(tr_qt_add_resources)
|
|
|
|
qt4_add_resources(${ARGN})
|
|
|
|
endmacro()
|
|
|
|
macro(tr_qt_add_translation)
|
|
|
|
qt4_add_translation(${ARGN})
|
|
|
|
endmacro()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(${PROJECT_NAME}_SOURCES
|
2015-06-10 21:27:11 +00:00
|
|
|
AboutDialog.cc
|
|
|
|
AddData.cc
|
|
|
|
Application.cc
|
|
|
|
ColumnResizer.cc
|
|
|
|
DBusAdaptor.cc
|
|
|
|
DetailsDialog.cc
|
|
|
|
FaviconCache.cc
|
|
|
|
FileTreeDelegate.cc
|
|
|
|
FileTreeItem.cc
|
|
|
|
FileTreeModel.cc
|
|
|
|
FileTreeView.cc
|
|
|
|
FilterBar.cc
|
|
|
|
FilterBarComboBox.cc
|
|
|
|
FilterBarComboBoxDelegate.cc
|
|
|
|
FilterBarLineEdit.cc
|
|
|
|
Filters.cc
|
|
|
|
Formatter.cc
|
|
|
|
FreeSpaceLabel.cc
|
|
|
|
IconToolButton.cc
|
|
|
|
LicenseDialog.cc
|
|
|
|
MainWindow.cc
|
|
|
|
MakeDialog.cc
|
|
|
|
OptionsDialog.cc
|
|
|
|
PathButton.cc
|
|
|
|
Prefs.cc
|
|
|
|
PrefsDialog.cc
|
|
|
|
RelocateDialog.cc
|
|
|
|
RpcClient.cc
|
|
|
|
Session.cc
|
|
|
|
SessionDialog.cc
|
|
|
|
SqueezeLabel.cc
|
|
|
|
StatsDialog.cc
|
|
|
|
Torrent.cc
|
|
|
|
TorrentDelegate.cc
|
|
|
|
TorrentDelegateMin.cc
|
|
|
|
TorrentFilter.cc
|
|
|
|
TorrentModel.cc
|
|
|
|
TrackerDelegate.cc
|
|
|
|
TrackerModel.cc
|
|
|
|
TrackerModelFilter.cc
|
|
|
|
Utils.cc
|
|
|
|
WatchDir.cc
|
2014-12-01 19:55:22 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
set(${PROJECT_NAME}_HEADERS
|
2015-06-10 21:27:11 +00:00
|
|
|
AboutDialog.h
|
|
|
|
AddData.h
|
|
|
|
Application.h
|
2015-09-01 20:19:26 +00:00
|
|
|
BaseDialog.h
|
2015-06-10 21:27:11 +00:00
|
|
|
ColumnResizer.h
|
|
|
|
CustomVariantType.h
|
|
|
|
DBusAdaptor.h
|
|
|
|
DetailsDialog.h
|
|
|
|
FaviconCache.h
|
|
|
|
FileTreeDelegate.h
|
|
|
|
FileTreeItem.h
|
|
|
|
FileTreeModel.h
|
|
|
|
FileTreeView.h
|
|
|
|
FilterBar.h
|
|
|
|
FilterBarComboBox.h
|
|
|
|
FilterBarComboBoxDelegate.h
|
|
|
|
FilterBarLineEdit.h
|
|
|
|
Filters.h
|
|
|
|
Formatter.h
|
|
|
|
FreeSpaceLabel.h
|
|
|
|
IconToolButton.h
|
|
|
|
LicenseDialog.h
|
|
|
|
MainWindow.h
|
|
|
|
MakeDialog.h
|
|
|
|
OptionsDialog.h
|
|
|
|
PathButton.h
|
|
|
|
Prefs.h
|
|
|
|
PrefsDialog.h
|
|
|
|
RelocateDialog.h
|
|
|
|
RpcClient.h
|
|
|
|
Session.h
|
|
|
|
SessionDialog.h
|
|
|
|
Speed.h
|
|
|
|
SqueezeLabel.h
|
|
|
|
StatsDialog.h
|
|
|
|
Torrent.h
|
|
|
|
TorrentDelegate.h
|
|
|
|
TorrentDelegateMin.h
|
|
|
|
TorrentFilter.h
|
|
|
|
TorrentModel.h
|
|
|
|
TrackerDelegate.h
|
|
|
|
TrackerModel.h
|
|
|
|
TrackerModelFilter.h
|
|
|
|
Utils.h
|
|
|
|
WatchDir.h
|
2014-12-01 19:55:22 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
tr_qt_wrap_ui(${PROJECT_NAME}_UI_SOURCES
|
2015-06-10 21:27:11 +00:00
|
|
|
AboutDialog.ui
|
|
|
|
DetailsDialog.ui
|
2015-07-30 06:18:02 +00:00
|
|
|
LicenseDialog.ui
|
2015-06-10 21:27:11 +00:00
|
|
|
MainWindow.ui
|
|
|
|
MakeDialog.ui
|
|
|
|
MakeProgressDialog.ui
|
|
|
|
OptionsDialog.ui
|
|
|
|
PrefsDialog.ui
|
|
|
|
RelocateDialog.ui
|
|
|
|
SessionDialog.ui
|
|
|
|
StatsDialog.ui
|
2014-12-01 19:55:22 +00:00
|
|
|
)
|
|
|
|
|
2015-01-04 02:14:58 +00:00
|
|
|
set(${PROJECT_NAME}_QRC_FILES application.qrc)
|
|
|
|
if(WIN32 OR APPLE)
|
|
|
|
list(APPEND ${PROJECT_NAME}_QRC_FILES icons/Faenza/Faenza.qrc)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
tr_qt_add_resources(${PROJECT_NAME}_QRC_SOURCES ${${PROJECT_NAME}_QRC_FILES})
|
2014-12-01 19:55:22 +00:00
|
|
|
|
|
|
|
set(${PROJECT_NAME}_LINGUAS
|
2015-08-10 20:43:26 +00:00
|
|
|
de
|
2014-12-01 19:55:22 +00:00
|
|
|
en
|
|
|
|
es
|
|
|
|
eu
|
|
|
|
fr
|
|
|
|
hu
|
2015-08-10 20:43:26 +00:00
|
|
|
id
|
2014-12-01 19:55:22 +00:00
|
|
|
kk
|
|
|
|
lt
|
2015-06-10 22:51:53 +00:00
|
|
|
pl_PL
|
2014-12-01 19:55:22 +00:00
|
|
|
pt_BR
|
|
|
|
ru
|
|
|
|
uk
|
2015-04-15 20:26:38 +00:00
|
|
|
zh_CN
|
2014-12-01 19:55:22 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
if(ENABLE_NLS)
|
|
|
|
set(${PROJECT_NAME}_ENABLED_LINGUAS ${${PROJECT_NAME}_LINGUAS})
|
|
|
|
else()
|
|
|
|
set(${PROJECT_NAME}_ENABLED_LINGUAS)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(${PROJECT_NAME}_TS_FILES)
|
|
|
|
foreach(LANG ${${PROJECT_NAME}_ENABLED_LINGUAS})
|
|
|
|
list(APPEND ${PROJECT_NAME}_TS_FILES translations/transmission_${LANG}.ts)
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
if(${PROJECT_NAME}_TS_FILES)
|
|
|
|
tr_qt_add_translation(${PROJECT_NAME}_QM_FILES ${${PROJECT_NAME}_TS_FILES})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
include_directories(
|
|
|
|
${CMAKE_SOURCE_DIR}
|
|
|
|
${PROJECT_SOURCE_DIR}
|
|
|
|
${PROJECT_BINARY_DIR}
|
|
|
|
${CURL_INCLUDE_DIRS}
|
|
|
|
${EVENT2_INCLUDE_DIRS}
|
|
|
|
)
|
|
|
|
|
2014-12-22 01:08:19 +00:00
|
|
|
add_definitions(
|
|
|
|
"-DTRANSLATIONS_DIR=\"${CMAKE_INSTALL_FULL_DATADIR}/${TR_NAME}/translations\""
|
2015-01-29 21:53:05 +00:00
|
|
|
-DQT_NO_CAST_FROM_ASCII
|
2014-12-22 01:08:19 +00:00
|
|
|
)
|
|
|
|
|
2015-04-14 22:46:40 +00:00
|
|
|
tr_win32_app_info(${PROJECT_NAME}_WIN32_RC_FILE
|
|
|
|
"Transmission Qt Client"
|
|
|
|
"transmission-qt"
|
|
|
|
"transmission-qt.exe"
|
|
|
|
"qtr.ico")
|
|
|
|
|
2015-01-04 10:57:09 +00:00
|
|
|
add_executable(${TR_NAME}-qt WIN32
|
2014-12-01 19:55:22 +00:00
|
|
|
${${PROJECT_NAME}_SOURCES}
|
|
|
|
${${PROJECT_NAME}_UI_SOURCES}
|
|
|
|
${${PROJECT_NAME}_QRC_SOURCES}
|
|
|
|
${${PROJECT_NAME}_HEADERS}
|
|
|
|
${${PROJECT_NAME}_QM_FILES}
|
2015-04-14 22:46:40 +00:00
|
|
|
${${PROJECT_NAME}_WIN32_RC_FILE}
|
2014-12-01 19:55:22 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries(${TR_NAME}-qt
|
|
|
|
${TR_NAME}
|
|
|
|
${QT_LIBRARIES}
|
|
|
|
${CURL_LIBRARIES}
|
|
|
|
${EVENT2_LIBRARIES}
|
|
|
|
)
|
|
|
|
|
2015-01-04 10:57:09 +00:00
|
|
|
if(MSVC)
|
|
|
|
tr_append_target_property(${TR_NAME}-qt LINK_FLAGS "/ENTRY:mainCRTStartup")
|
|
|
|
endif()
|
|
|
|
|
2014-12-01 19:55:22 +00:00
|
|
|
if(USE_QT5)
|
|
|
|
qt5_use_modules(${TR_NAME}-qt ${TR_QT5_MODULES})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set_target_properties(${TR_NAME}-qt PROPERTIES AUTOMOC TRUE)
|
|
|
|
|
|
|
|
install(TARGETS ${TR_NAME}-qt DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
|
|
|
|
|
|
if(INSTALL_DOC)
|
|
|
|
install(FILES ${TR_NAME}-qt.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
install(FILES transmission-qt.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
|
2014-12-22 01:08:19 +00:00
|
|
|
|
|
|
|
if(ENABLE_NLS)
|
|
|
|
install(FILES ${${PROJECT_NAME}_QM_FILES} DESTINATION ${CMAKE_INSTALL_DATADIR}/${TR_NAME}/translations)
|
|
|
|
endif()
|