2014-12-01 19:55:22 +00:00
|
|
|
project(trqt)
|
|
|
|
|
|
|
|
set(${PROJECT_NAME}_SOURCES
|
2015-06-10 21:27:11 +00:00
|
|
|
AboutDialog.cc
|
|
|
|
AddData.cc
|
|
|
|
Application.cc
|
|
|
|
ColumnResizer.cc
|
2015-12-16 20:01:03 +00:00
|
|
|
ComInteropHelper.cc
|
2015-12-16 17:57:05 +00:00
|
|
|
DBusInteropHelper.cc
|
2015-06-10 21:27:11 +00:00
|
|
|
DetailsDialog.cc
|
|
|
|
FaviconCache.cc
|
|
|
|
FileTreeDelegate.cc
|
|
|
|
FileTreeItem.cc
|
|
|
|
FileTreeModel.cc
|
|
|
|
FileTreeView.cc
|
|
|
|
FilterBar.cc
|
|
|
|
FilterBarComboBox.cc
|
|
|
|
FilterBarComboBoxDelegate.cc
|
|
|
|
Filters.cc
|
|
|
|
Formatter.cc
|
|
|
|
FreeSpaceLabel.cc
|
2020-08-15 15:42:51 +00:00
|
|
|
IconCache.cc
|
2015-06-10 21:27:11 +00:00
|
|
|
IconToolButton.cc
|
2015-12-16 20:01:03 +00:00
|
|
|
InteropHelper.cc
|
2015-12-16 17:57:05 +00:00
|
|
|
InteropObject.cc
|
2015-06-10 21:27:11 +00:00
|
|
|
LicenseDialog.cc
|
|
|
|
MainWindow.cc
|
|
|
|
MakeDialog.cc
|
|
|
|
OptionsDialog.cc
|
|
|
|
PathButton.cc
|
|
|
|
Prefs.cc
|
|
|
|
PrefsDialog.cc
|
|
|
|
RelocateDialog.cc
|
|
|
|
RpcClient.cc
|
2016-04-19 20:41:59 +00:00
|
|
|
RpcQueue.cc
|
2015-06-10 21:27:11 +00:00
|
|
|
Session.cc
|
|
|
|
SessionDialog.cc
|
|
|
|
SqueezeLabel.cc
|
|
|
|
StatsDialog.cc
|
2017-02-07 22:06:28 +00:00
|
|
|
StyleHelper.cc
|
2015-06-10 21:27:11 +00:00
|
|
|
Torrent.cc
|
|
|
|
TorrentDelegate.cc
|
|
|
|
TorrentDelegateMin.cc
|
|
|
|
TorrentFilter.cc
|
|
|
|
TorrentModel.cc
|
2015-10-19 20:30:26 +00:00
|
|
|
TorrentView.cc
|
2015-06-10 21:27:11 +00:00
|
|
|
TrackerDelegate.cc
|
|
|
|
TrackerModel.cc
|
|
|
|
TrackerModelFilter.cc
|
|
|
|
Utils.cc
|
2020-07-27 04:30:58 +00:00
|
|
|
VariantHelpers.cc
|
2015-06-10 21:27:11 +00:00
|
|
|
WatchDir.cc
|
2014-12-01 19:55:22 +00:00
|
|
|
)
|
|
|
|
|
2020-08-11 18:11:55 +00:00
|
|
|
string(REPLACE ";" " " CXX_WARNING_FLAGS_STR "${CXX_WARNING_FLAGS}")
|
|
|
|
foreach(FILE ${${PROJECT_NAME}_SOURCES})
|
|
|
|
set_source_files_properties(${FILE} PROPERTIES COMPILE_FLAGS "${CXX_WARNING_FLAGS_STR}")
|
|
|
|
endforeach()
|
|
|
|
|
2015-12-17 18:10:43 +00:00
|
|
|
if (NOT ENABLE_QT_COM_INTEROP)
|
2015-12-16 20:01:03 +00:00
|
|
|
set_source_files_properties(ComInteropHelper.cc PROPERTIES HEADER_FILE_ONLY ON)
|
|
|
|
endif()
|
2015-12-17 18:10:43 +00:00
|
|
|
if (NOT ENABLE_QT_DBUS_INTEROP)
|
2015-12-16 20:01:03 +00:00
|
|
|
set_source_files_properties(DBusInteropHelper.cc PROPERTIES HEADER_FILE_ONLY ON)
|
|
|
|
endif()
|
|
|
|
|
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
|
2015-12-16 20:01:03 +00:00
|
|
|
ComInteropHelper.h
|
2015-06-10 21:27:11 +00:00
|
|
|
CustomVariantType.h
|
2015-12-16 17:57:05 +00:00
|
|
|
DBusInteropHelper.h
|
2015-06-10 21:27:11 +00:00
|
|
|
DetailsDialog.h
|
|
|
|
FaviconCache.h
|
|
|
|
FileTreeDelegate.h
|
|
|
|
FileTreeItem.h
|
|
|
|
FileTreeModel.h
|
|
|
|
FileTreeView.h
|
|
|
|
FilterBar.h
|
|
|
|
FilterBarComboBox.h
|
|
|
|
FilterBarComboBoxDelegate.h
|
|
|
|
Filters.h
|
|
|
|
Formatter.h
|
|
|
|
FreeSpaceLabel.h
|
2020-08-15 15:42:51 +00:00
|
|
|
IconCache.h
|
2015-06-10 21:27:11 +00:00
|
|
|
IconToolButton.h
|
2015-12-16 20:01:03 +00:00
|
|
|
InteropHelper.h
|
2015-12-16 17:57:05 +00:00
|
|
|
InteropObject.h
|
2015-06-10 21:27:11 +00:00
|
|
|
LicenseDialog.h
|
|
|
|
MainWindow.h
|
|
|
|
MakeDialog.h
|
|
|
|
OptionsDialog.h
|
|
|
|
PathButton.h
|
|
|
|
Prefs.h
|
|
|
|
PrefsDialog.h
|
|
|
|
RelocateDialog.h
|
|
|
|
RpcClient.h
|
2016-04-19 20:41:59 +00:00
|
|
|
RpcQueue.h
|
2015-06-10 21:27:11 +00:00
|
|
|
Session.h
|
|
|
|
SessionDialog.h
|
|
|
|
Speed.h
|
|
|
|
SqueezeLabel.h
|
|
|
|
StatsDialog.h
|
2017-02-07 22:06:28 +00:00
|
|
|
StyleHelper.h
|
2015-06-10 21:27:11 +00:00
|
|
|
Torrent.h
|
|
|
|
TorrentDelegate.h
|
|
|
|
TorrentDelegateMin.h
|
|
|
|
TorrentFilter.h
|
|
|
|
TorrentModel.h
|
2015-10-19 20:30:26 +00:00
|
|
|
TorrentView.h
|
2015-06-10 21:27:11 +00:00
|
|
|
TrackerDelegate.h
|
|
|
|
TrackerModel.h
|
|
|
|
TrackerModelFilter.h
|
2019-11-12 01:37:05 +00:00
|
|
|
Typedefs.h
|
2015-06-10 21:27:11 +00:00
|
|
|
Utils.h
|
2020-07-27 04:30:58 +00:00
|
|
|
VariantHelpers.h
|
2015-06-10 21:27:11 +00:00
|
|
|
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
|
2019-03-13 20:35:16 +00:00
|
|
|
af
|
|
|
|
ca
|
|
|
|
da
|
2015-08-10 20:43:26 +00:00
|
|
|
de
|
2019-03-13 20:35:16 +00:00
|
|
|
el
|
2014-12-01 19:55:22 +00:00
|
|
|
en
|
|
|
|
es
|
|
|
|
eu
|
2020-05-14 16:17:11 +00:00
|
|
|
fi
|
2014-12-01 19:55:22 +00:00
|
|
|
fr
|
|
|
|
hu
|
2015-08-10 20:43:26 +00:00
|
|
|
id
|
2015-12-12 18:14:15 +00:00
|
|
|
it_IT
|
2020-05-02 10:26:24 +00:00
|
|
|
ja
|
2017-01-26 20:14:00 +00:00
|
|
|
ka
|
2014-12-01 19:55:22 +00:00
|
|
|
kk
|
2015-12-12 18:14:15 +00:00
|
|
|
ko
|
2014-12-01 19:55:22 +00:00
|
|
|
lt
|
2019-03-13 20:35:16 +00:00
|
|
|
nb
|
2017-01-26 20:14:00 +00:00
|
|
|
nl
|
2017-05-19 20:11:06 +00:00
|
|
|
pl
|
2014-12-01 19:55:22 +00:00
|
|
|
pt_BR
|
2017-05-19 21:13:57 +00:00
|
|
|
pt_PT
|
2014-12-01 19:55:22 +00:00
|
|
|
ru
|
2019-03-13 20:35:16 +00:00
|
|
|
sl
|
2017-01-26 20:14:00 +00:00
|
|
|
sv
|
2017-05-19 18:49:04 +00:00
|
|
|
tr
|
2014-12-01 19:55:22 +00:00
|
|
|
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}
|
2020-08-11 18:11:55 +00:00
|
|
|
)
|
|
|
|
include_directories(
|
|
|
|
SYSTEM
|
2014-12-01 19:55:22 +00:00
|
|
|
${PROJECT_BINARY_DIR}
|
|
|
|
${CURL_INCLUDE_DIRS}
|
|
|
|
${EVENT2_INCLUDE_DIRS}
|
|
|
|
)
|
|
|
|
|
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-12-17 18:10:43 +00:00
|
|
|
if(ENABLE_QT_COM_INTEROP)
|
2015-12-16 20:01:03 +00:00
|
|
|
add_custom_command(
|
|
|
|
OUTPUT
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/transmission-qt.tlb
|
|
|
|
COMMAND
|
|
|
|
${MIDL_EXECUTABLE} /tlb ${CMAKE_CURRENT_BINARY_DIR}/transmission-qt.tlb transmission-qt.idl
|
|
|
|
DEPENDS
|
|
|
|
transmission-qt.idl
|
|
|
|
WORKING_DIRECTORY
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
)
|
|
|
|
list(APPEND ${PROJECT_NAME}_WIN32_RC_FILE transmission-qt.tlb.rc transmission-qt.idl ${CMAKE_CURRENT_BINARY_DIR}/transmission-qt.tlb)
|
|
|
|
set_source_files_properties(transmission-qt.idl ${CMAKE_CURRENT_BINARY_DIR}/transmission-qt.tlb PROPERTIES HEADER_FILE_ONLY ON)
|
|
|
|
endif()
|
|
|
|
|
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}
|
2015-12-16 18:46:06 +00:00
|
|
|
${QT_TARGETS}
|
2014-12-01 19:55:22 +00:00
|
|
|
${CURL_LIBRARIES}
|
|
|
|
${EVENT2_LIBRARIES}
|
|
|
|
)
|
|
|
|
|
2015-12-16 20:01:03 +00:00
|
|
|
target_compile_definitions(${TR_NAME}-qt PRIVATE
|
|
|
|
"TRANSLATIONS_DIR=\"${CMAKE_INSTALL_FULL_DATADIR}/${TR_NAME}/translations\""
|
|
|
|
QT_NO_CAST_FROM_ASCII
|
2015-12-17 18:10:43 +00:00
|
|
|
$<$<BOOL:${ENABLE_QT_COM_INTEROP}>:ENABLE_COM_INTEROP>
|
|
|
|
$<$<BOOL:${ENABLE_QT_DBUS_INTEROP}>:ENABLE_DBUS_INTEROP>)
|
2015-12-16 20:01:03 +00:00
|
|
|
|
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
|
|
|
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()
|
2016-04-02 18:01:01 +00:00
|
|
|
|
|
|
|
if(WIN32)
|
|
|
|
file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/dist-qt.conf" CONTENT "")
|
|
|
|
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/dist-qt.conf" DESTINATION ${CMAKE_INSTALL_SYSCONFDIR} RENAME qt.conf)
|
|
|
|
endif()
|