2023-01-01 19:49:48 +00:00
|
|
|
find_program(APPSTREAM appstreamcli)
|
2020-08-11 18:11:55 +00:00
|
|
|
|
2023-01-01 19:49:48 +00:00
|
|
|
add_executable(${TR_NAME}-gtk WIN32)
|
|
|
|
|
|
|
|
target_sources(${TR_NAME}-gtk
|
|
|
|
PRIVATE
|
|
|
|
Actions.cc
|
|
|
|
Actions.h
|
|
|
|
Application.cc
|
|
|
|
Application.h
|
|
|
|
DetailsDialog.cc
|
|
|
|
DetailsDialog.h
|
|
|
|
Dialogs.cc
|
|
|
|
Dialogs.h
|
2023-08-06 03:26:29 +00:00
|
|
|
DynamicPropertyStore.h
|
2023-01-01 19:49:48 +00:00
|
|
|
FaviconCache.cc
|
|
|
|
FileList.cc
|
|
|
|
FileList.h
|
|
|
|
FilterBar.cc
|
|
|
|
FilterBar.h
|
2023-01-08 15:31:03 +00:00
|
|
|
FilterBase.h
|
|
|
|
FilterBase.hh
|
|
|
|
FilterListModel.h
|
|
|
|
FilterListModel.hh
|
2023-01-01 19:49:48 +00:00
|
|
|
Flags.h
|
|
|
|
FreeSpaceLabel.cc
|
|
|
|
FreeSpaceLabel.h
|
|
|
|
GtkCompat.h
|
|
|
|
HigWorkarea.h
|
|
|
|
IconCache.cc
|
|
|
|
IconCache.h
|
|
|
|
ListModelAdapter.cc
|
|
|
|
ListModelAdapter.h
|
|
|
|
main.cc
|
|
|
|
MainWindow.cc
|
|
|
|
MainWindow.h
|
|
|
|
MakeDialog.cc
|
|
|
|
MakeDialog.h
|
|
|
|
MessageLogWindow.cc
|
|
|
|
MessageLogWindow.h
|
|
|
|
Notify.cc
|
|
|
|
Notify.h
|
|
|
|
OptionsDialog.cc
|
|
|
|
OptionsDialog.h
|
|
|
|
PathButton.cc
|
|
|
|
PathButton.h
|
2023-02-18 01:14:01 +00:00
|
|
|
Percents.cc
|
|
|
|
Percents.h
|
2023-01-01 19:49:48 +00:00
|
|
|
Prefs.cc
|
|
|
|
Prefs.h
|
|
|
|
PrefsDialog.cc
|
|
|
|
PrefsDialog.h
|
|
|
|
RelocateDialog.cc
|
|
|
|
RelocateDialog.h
|
|
|
|
Session.cc
|
|
|
|
Session.h
|
2023-01-08 15:31:03 +00:00
|
|
|
SorterBase.h
|
|
|
|
SorterBase.hh
|
|
|
|
SortListModel.h
|
|
|
|
SortListModel.hh
|
2023-01-01 19:49:48 +00:00
|
|
|
StatsDialog.cc
|
|
|
|
StatsDialog.h
|
|
|
|
SystemTrayIcon.cc
|
|
|
|
SystemTrayIcon.h
|
|
|
|
Torrent.cc
|
|
|
|
Torrent.h
|
|
|
|
TorrentCellRenderer.cc
|
|
|
|
TorrentCellRenderer.h
|
|
|
|
TorrentFilter.cc
|
|
|
|
TorrentFilter.h
|
|
|
|
TorrentSorter.cc
|
|
|
|
TorrentSorter.h
|
|
|
|
Utils.cc
|
|
|
|
Utils.h)
|
|
|
|
|
2023-08-06 03:26:29 +00:00
|
|
|
tr_allow_compile_if(
|
|
|
|
[=[[GTK_VERSION EQUAL 3]]=]
|
|
|
|
TorrentCellRenderer.cc)
|
|
|
|
|
2023-01-01 19:49:48 +00:00
|
|
|
target_sources(${TR_NAME}-gtk
|
|
|
|
PRIVATE
|
|
|
|
ui/gtk3/AddTrackerDialog.ui
|
|
|
|
ui/gtk3/DetailsDialog.ui
|
|
|
|
ui/gtk3/EditTrackersDialog.ui
|
|
|
|
ui/gtk3/FilterBar.ui
|
|
|
|
ui/gtk3/MainWindow.ui
|
|
|
|
ui/gtk3/MakeDialog.ui
|
|
|
|
ui/gtk3/MakeProgressDialog.ui
|
|
|
|
ui/gtk3/MessageLogWindow.ui
|
|
|
|
ui/gtk3/OptionsDialog.ui
|
|
|
|
ui/gtk3/PrefsDialog.ui
|
|
|
|
ui/gtk3/RelocateDialog.ui
|
|
|
|
ui/gtk3/StatsDialog.ui
|
|
|
|
ui/gtk3/TorrentUrlChooserDialog.ui)
|
|
|
|
|
|
|
|
source_group(Ui/GTK3
|
|
|
|
REGULAR_EXPRESSION [[ui/gtk3/.*\.ui$]])
|
|
|
|
|
|
|
|
target_sources(${TR_NAME}-gtk
|
|
|
|
PRIVATE
|
|
|
|
ui/gtk4/AddTrackerDialog.ui
|
|
|
|
ui/gtk4/DetailsDialog.ui
|
|
|
|
ui/gtk4/EditTrackersDialog.ui
|
|
|
|
ui/gtk4/FilterBar.ui
|
|
|
|
ui/gtk4/MainWindow.ui
|
|
|
|
ui/gtk4/MakeDialog.ui
|
|
|
|
ui/gtk4/MakeProgressDialog.ui
|
|
|
|
ui/gtk4/MessageLogWindow.ui
|
|
|
|
ui/gtk4/OptionsDialog.ui
|
|
|
|
ui/gtk4/PrefsDialog.ui
|
|
|
|
ui/gtk4/RelocateDialog.ui
|
|
|
|
ui/gtk4/StatsDialog.ui
|
2023-08-06 03:26:29 +00:00
|
|
|
ui/gtk4/TorrentListItemCompact.ui
|
|
|
|
ui/gtk4/TorrentListItemFull.ui
|
2023-01-01 19:49:48 +00:00
|
|
|
ui/gtk4/TorrentUrlChooserDialog.ui)
|
|
|
|
|
|
|
|
source_group(Ui/GTK4
|
|
|
|
REGULAR_EXPRESSION [[ui/gtk4/.*\.ui$]])
|
|
|
|
|
|
|
|
if(WITH_APPINDICATOR)
|
|
|
|
set_property(
|
|
|
|
SOURCE SystemTrayIcon.cc
|
|
|
|
APPEND
|
|
|
|
PROPERTY COMPILE_DEFINITIONS
|
|
|
|
HAVE_APPINDICATOR)
|
|
|
|
if(APPINDICATOR_IS_AYATANA)
|
|
|
|
set_property(
|
|
|
|
SOURCE SystemTrayIcon.cc
|
|
|
|
APPEND
|
|
|
|
PROPERTY COMPILE_DEFINITIONS
|
|
|
|
APPINDICATOR_IS_AYATANA)
|
|
|
|
endif()
|
2014-12-01 19:55:22 +00:00
|
|
|
endif()
|
|
|
|
|
2022-10-08 22:50:03 +00:00
|
|
|
if(GTK_VERSION EQUAL 4)
|
|
|
|
set(UI_SUBDIR ui/gtk4)
|
|
|
|
else()
|
|
|
|
set(UI_SUBDIR ui/gtk3)
|
|
|
|
endif()
|
|
|
|
|
2023-01-01 19:49:48 +00:00
|
|
|
tr_target_glib_resources(${TR_NAME}-gtk
|
|
|
|
transmission.gresource.xml
|
|
|
|
${UI_SUBDIR}/transmission-ui.gresource.xml)
|
2014-12-01 19:55:22 +00:00
|
|
|
|
|
|
|
if(ENABLE_NLS)
|
2023-01-01 19:49:48 +00:00
|
|
|
set(DESKTOP_FILE "${CMAKE_CURRENT_BINARY_DIR}/${TR_NAME}-gtk.desktop")
|
|
|
|
tr_gettext_msgfmt(${TR_NAME}-gtk
|
|
|
|
${DESKTOP_FILE}
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/transmission-gtk.desktop.in)
|
|
|
|
target_sources(${TR_NAME}-gtk
|
|
|
|
PRIVATE
|
|
|
|
${DESKTOP_FILE})
|
|
|
|
|
|
|
|
set(METAINFO_FILE "${CMAKE_CURRENT_BINARY_DIR}/${TR_NAME}-gtk.metainfo.xml")
|
|
|
|
tr_gettext_msgfmt(${TR_NAME}-gtk
|
|
|
|
${METAINFO_FILE}
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/transmission-gtk.metainfo.xml.in)
|
|
|
|
target_sources(${TR_NAME}-gtk
|
|
|
|
PRIVATE
|
|
|
|
${METAINFO_FILE})
|
2022-10-09 07:29:47 +00:00
|
|
|
endif()
|
|
|
|
|
2023-01-01 19:49:48 +00:00
|
|
|
target_compile_definitions(${TR_NAME}-gtk
|
|
|
|
PRIVATE
|
|
|
|
TRANSMISSIONLOCALEDIR="${CMAKE_INSTALL_FULL_LOCALEDIR}"
|
|
|
|
GETTEXT_PACKAGE="${TR_NAME}-gtk"
|
|
|
|
$<$<BOOL:${ENABLE_UTP}>:WITH_UTP>)
|
|
|
|
|
2023-03-27 16:04:10 +00:00
|
|
|
if(NOT ENABLE_DEPRECATED)
|
|
|
|
target_compile_definitions(${TR_NAME}-gtk
|
|
|
|
PRIVATE
|
|
|
|
G_DISABLE_DEPRECATED
|
|
|
|
GDK_PIXBUF_DISABLE_DEPRECATED
|
|
|
|
GDK_DISABLE_DEPRECATED
|
|
|
|
GTK_DISABLE_DEPRECATED
|
|
|
|
PANGO_DISABLE_DEPRECATED
|
|
|
|
GDKMM_DISABLE_DEPRECATED
|
|
|
|
GIOMM_DISABLE_DEPRECATED
|
|
|
|
GLIBMM_DISABLE_DEPRECATED
|
|
|
|
GTKMM_DISABLE_DEPRECATED
|
|
|
|
PANGOMM_DISABLE_DEPRECATED
|
|
|
|
SIGCXX_DISABLE_DEPRECATED)
|
2023-03-24 18:34:30 +00:00
|
|
|
endif()
|
|
|
|
|
2023-01-01 19:49:48 +00:00
|
|
|
target_compile_options(${TR_NAME}-gtk
|
|
|
|
PRIVATE
|
|
|
|
$<$<BOOL:${ENABLE_WERROR}>:$<IF:$<CXX_COMPILER_ID:MSVC>,/WX,-Werror>>
|
|
|
|
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-exit-time-destructors>)
|
|
|
|
|
|
|
|
target_include_directories(${TR_NAME}-gtk
|
|
|
|
PRIVATE
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
|
|
|
|
target_include_directories(${TR_NAME}-gtk SYSTEM
|
|
|
|
PRIVATE
|
|
|
|
$<$<BOOL:${WITH_APPINDICATOR}>:${APPINDICATOR_INCLUDE_DIRS}>)
|
2014-12-01 19:55:22 +00:00
|
|
|
|
2023-01-01 19:49:48 +00:00
|
|
|
target_link_libraries(${TR_NAME}-gtk
|
|
|
|
PRIVATE
|
|
|
|
${TR_NAME}
|
2023-01-02 16:23:51 +00:00
|
|
|
transmission::gtk_impl
|
|
|
|
fmt::fmt-header-only
|
2023-01-01 19:49:48 +00:00
|
|
|
$<$<BOOL:${WITH_APPINDICATOR}>:${APPINDICATOR_LIBRARIES}>)
|
2022-12-11 21:58:17 +00:00
|
|
|
|
2023-01-01 19:49:48 +00:00
|
|
|
if(MSVC)
|
|
|
|
tr_append_target_property(${TR_NAME}-gtk LINK_FLAGS "/ENTRY:mainCRTStartup")
|
2022-10-20 17:15:13 +00:00
|
|
|
endif()
|
|
|
|
|
2023-01-01 19:49:48 +00:00
|
|
|
tr_win32_app_info(${TR_NAME}-gtk
|
2015-04-14 22:46:40 +00:00
|
|
|
"Transmission GTK+ Client"
|
|
|
|
"${TR_NAME}-gtk"
|
|
|
|
"${TR_NAME}-gtk.exe"
|
|
|
|
"${TR_NAME}.ico")
|
|
|
|
|
2023-01-01 19:49:48 +00:00
|
|
|
install(
|
|
|
|
TARGETS ${TR_NAME}-gtk
|
|
|
|
DESTINATION ${CMAKE_INSTALL_BINDIR})
|
2014-12-01 19:55:22 +00:00
|
|
|
|
2023-01-01 19:49:48 +00:00
|
|
|
set(PUBLIC_ICONS
|
2014-12-01 19:55:22 +00:00
|
|
|
hicolor_apps_scalable_transmission.svg
|
2020-04-26 01:01:49 +00:00
|
|
|
hicolor_apps_scalable_transmission-devel.svg
|
2023-01-01 19:49:48 +00:00
|
|
|
hicolor_apps_symbolic_transmission-symbolic.svg)
|
2014-12-01 19:55:22 +00:00
|
|
|
|
|
|
|
set(ICON_NAME_REGEX "^([^_]+)_([^_]+)_([^_]+)_(.+)$")
|
2023-01-01 19:49:48 +00:00
|
|
|
foreach(ICON ${PUBLIC_ICONS})
|
2014-12-01 19:55:22 +00:00
|
|
|
string(REGEX REPLACE ${ICON_NAME_REGEX} "\\1/\\3/\\2" ICON_DIR ${ICON})
|
|
|
|
string(REGEX REPLACE ${ICON_NAME_REGEX} "\\4" ICON_NAME ${ICON})
|
2023-01-01 19:49:48 +00:00
|
|
|
install(
|
|
|
|
FILES icons/${ICON}
|
|
|
|
DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/${ICON_DIR}/
|
|
|
|
RENAME ${ICON_NAME})
|
2014-12-01 19:55:22 +00:00
|
|
|
endforeach()
|
|
|
|
|
|
|
|
if(INSTALL_DOC)
|
2023-01-01 19:49:48 +00:00
|
|
|
install(
|
|
|
|
FILES ${TR_NAME}-gtk.1
|
|
|
|
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
|
2014-12-01 19:55:22 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(ENABLE_NLS)
|
2023-01-01 19:49:48 +00:00
|
|
|
install(
|
|
|
|
FILES ${DESKTOP_FILE}
|
|
|
|
DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
|
|
|
|
install(
|
|
|
|
FILES ${METAINFO_FILE}
|
|
|
|
DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo)
|
2014-12-01 19:55:22 +00:00
|
|
|
else()
|
2023-01-01 19:49:48 +00:00
|
|
|
install(
|
|
|
|
FILES transmission-gtk.desktop.in
|
|
|
|
DESTINATION ${CMAKE_INSTALL_DATADIR}/applications
|
|
|
|
RENAME ${TR_NAME}-gtk.desktop)
|
2014-12-01 19:55:22 +00:00
|
|
|
endif()
|