mirror of
https://github.com/GerbilSoft/rom-properties.git
synced 2025-06-18 11:35:38 -04:00
[gtk] Split the D-Bus thumbnailer out from xfce/ and into thumbnailer-dbus/.
Preparations for Thunar 1.8.0, which was released today and uses GTK+ 3.x. NOTE: The .thumbnailer file is common for both GTK+ 2.x and 3.x, so it's installed as part of thumbnailer-dbus. [debian] Added a new package, rom-properties-thumbnailer-dbus. rom-properties-xfce and rom-properties-all now have dependencies on this package.
This commit is contained in:
parent
5d42d17248
commit
181084b9aa
19
debian/control
vendored
19
debian/control
vendored
@ -37,7 +37,7 @@ Vcs-Browser: https://github.com/GerbilSoft/rom-properties
|
|||||||
|
|
||||||
Package: rom-properties-all
|
Package: rom-properties-all
|
||||||
Architecture: any
|
Architecture: any
|
||||||
Depends: rom-properties-kde4, rom-properties-kde5, rom-properties-xfce, rom-properties-gnome, rom-properties-cli, rom-properties-stub, rom-properties-lang, ${misc:Depends}
|
Depends: rom-properties-kde4, rom-properties-kde5, rom-properties-xfce, rom-properties-gnome, rom-properties-cli, rom-properties-stub, rom-properties-lang, rom-properties-thumbnail-dbus, ${misc:Depends}
|
||||||
Description: ROM Properties Page shell extension
|
Description: ROM Properties Page shell extension
|
||||||
This shell extension provides thumbnailing and property page functionality
|
This shell extension provides thumbnailing and property page functionality
|
||||||
for ROM images, disc images, and save files for various game consoles,
|
for ROM images, disc images, and save files for various game consoles,
|
||||||
@ -69,14 +69,14 @@ Description: ROM Properties Page shell extension
|
|||||||
|
|
||||||
Package: rom-properties-xfce
|
Package: rom-properties-xfce
|
||||||
Architecture: any
|
Architecture: any
|
||||||
Depends: ${shlibs:Depends}, ${misc:Depends}
|
Depends: rom-properties-thumbnailer-dbus, ${shlibs:Depends}, ${misc:Depends}
|
||||||
Recommends: rom-properties-lang
|
Recommends: rom-properties-lang
|
||||||
Description: ROM Properties Page shell extension
|
Description: ROM Properties Page shell extension
|
||||||
This shell extension provides thumbnailing and property page functionality
|
This shell extension provides thumbnailing and property page functionality
|
||||||
for ROM images, disc images, and save files for various game consoles,
|
for ROM images, disc images, and save files for various game consoles,
|
||||||
including Nintendo GameCube and Wii.
|
including Nintendo GameCube and Wii.
|
||||||
.
|
.
|
||||||
This package contains the XFCE version.
|
This package contains the XFCE (GTK+ 2.x) version.
|
||||||
|
|
||||||
Package: rom-properties-gnome
|
Package: rom-properties-gnome
|
||||||
Architecture: any
|
Architecture: any
|
||||||
@ -122,3 +122,16 @@ Description: ROM Properties Page shell extension
|
|||||||
including Nintendo GameCube and Wii.
|
including Nintendo GameCube and Wii.
|
||||||
.
|
.
|
||||||
This package contains the language files for localization.
|
This package contains the language files for localization.
|
||||||
|
|
||||||
|
Package: rom-properties-thumbnailer-dbus
|
||||||
|
Architecture: any
|
||||||
|
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||||
|
Recommends: rom-properties-lang
|
||||||
|
Description: ROM Properties Page shell extension
|
||||||
|
This shell extension provides thumbnailing and property page functionality
|
||||||
|
for ROM images, disc images, and save files for various game consoles,
|
||||||
|
including Nintendo GameCube and Wii.
|
||||||
|
.
|
||||||
|
This package contains the D-Bus Thumbnailer service, used by XFCE's
|
||||||
|
tumblerd thumbnailing subsystem.
|
||||||
|
|
||||||
|
4
debian/rom-properties-thumbnailer-dbus.docs
vendored
Normal file
4
debian/rom-properties-thumbnailer-dbus.docs
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
README.md
|
||||||
|
NEWS.md
|
||||||
|
doc/keys.conf.example
|
||||||
|
doc/rom-properties.conf.example
|
3
debian/rom-properties-thumbnailer-dbus.install
vendored
Normal file
3
debian/rom-properties-thumbnailer-dbus.install
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
usr/bin/rp-thumbnailer-dbus
|
||||||
|
usr/share/dbus-1/services/com.gerbilsoft.rom-properties.SpecializedThumbnailer1.service
|
||||||
|
usr/share/xfce4/thumbnailers/com.gerbilsoft.rom-properties.SpecializedThumbnailer1.service
|
3
debian/rom-properties-xfce.install
vendored
3
debian/rom-properties-xfce.install
vendored
@ -1,4 +1 @@
|
|||||||
usr/lib/*/thunarx-2/rom-properties-xfce.so
|
usr/lib/*/thunarx-2/rom-properties-xfce.so
|
||||||
usr/bin/rp-thumbnailer-dbus
|
|
||||||
usr/share/dbus-1/services/com.gerbilsoft.rom-properties.SpecializedThumbnailer1.service
|
|
||||||
usr/share/xfce4/thumbnailers/com.gerbilsoft.rom-properties.SpecializedThumbnailer1.service
|
|
||||||
|
@ -69,12 +69,14 @@ IF(GLib2_FOUND AND GObject2_FOUND)
|
|||||||
# Cannot build GTK3 frontends.
|
# Cannot build GTK3 frontends.
|
||||||
SET(BUILD_GTK3 OFF CACHE "" INTERNAL FORCE)
|
SET(BUILD_GTK3 OFF CACHE "" INTERNAL FORCE)
|
||||||
SET(BUILD_GNOME OFF CACHE "" INTERNAL FORCE)
|
SET(BUILD_GNOME OFF CACHE "" INTERNAL FORCE)
|
||||||
|
SET(BUILD_XFCE3 OFF CACHE "" INTERNAL FORCE)
|
||||||
ENDIF(NOT Cairo_FOUND)
|
ENDIF(NOT Cairo_FOUND)
|
||||||
ELSE(GLib2_FOUND AND GObject2_FOUND)
|
ELSE(GLib2_FOUND AND GObject2_FOUND)
|
||||||
# Cannot build any GTK+ frontends.
|
# Cannot build any GTK+ frontends.
|
||||||
SET(BUILD_GTK2 OFF CACHE "" INTERNAL FORCE)
|
SET(BUILD_GTK2 OFF CACHE "" INTERNAL FORCE)
|
||||||
SET(BUILD_GTK3 OFF CACHE "" INTERNAL FORCE)
|
SET(BUILD_GTK3 OFF CACHE "" INTERNAL FORCE)
|
||||||
SET(BUILD_XFCE OFF CACHE "" INTERNAL FORCE)
|
SET(BUILD_XFCE OFF CACHE "" INTERNAL FORCE)
|
||||||
|
SET(BUILD_XFCE3 OFF CACHE "" INTERNAL FORCE)
|
||||||
SET(BUILD_GNOME OFF CACHE "" INTERNAL FORCE)
|
SET(BUILD_GNOME OFF CACHE "" INTERNAL FORCE)
|
||||||
ENDIF(GLib2_FOUND AND GObject2_FOUND)
|
ENDIF(GLib2_FOUND AND GObject2_FOUND)
|
||||||
|
|
||||||
@ -99,6 +101,8 @@ IF(BUILD_GTK3)
|
|||||||
FIND_PACKAGE(GTK3 3.10.0 ${REQUIRE_GTK3})
|
FIND_PACKAGE(GTK3 3.10.0 ${REQUIRE_GTK3})
|
||||||
IF(GTK3_FOUND)
|
IF(GTK3_FOUND)
|
||||||
ADD_SUBDIRECTORY(gnome)
|
ADD_SUBDIRECTORY(gnome)
|
||||||
|
# TODO: Thunar 1.8 is ported to GTK+ 3.0.
|
||||||
|
#ADD_SUBDIRECTORY(xfce3)
|
||||||
ELSE(GTK3_FOUND)
|
ELSE(GTK3_FOUND)
|
||||||
SET(BUILD_GTK3 OFF CACHE "" INTERNAL FORCE)
|
SET(BUILD_GTK3 OFF CACHE "" INTERNAL FORCE)
|
||||||
SET(BUILD_GNOME OFF CACHE "" INTERNAL FORCE)
|
SET(BUILD_GNOME OFF CACHE "" INTERNAL FORCE)
|
||||||
@ -107,3 +111,9 @@ ELSE(BUILD_GTK3)
|
|||||||
# No GTK3 builds.
|
# No GTK3 builds.
|
||||||
SET(BUILD_GNOME OFF CACHE "" INTERNAL FORCE)
|
SET(BUILD_GNOME OFF CACHE "" INTERNAL FORCE)
|
||||||
ENDIF(BUILD_GTK3)
|
ENDIF(BUILD_GTK3)
|
||||||
|
|
||||||
|
# Build the D-Bus thumbnailer if building an XFCE plugin.
|
||||||
|
IF(BUILD_XFCE OR BUILD_XFCE3)
|
||||||
|
SET(BUILD_THUMBNAILER_DBUS ON CACHE "" INTERNAL FORCE)
|
||||||
|
ADD_SUBDIRECTORY(thumbnailer-dbus)
|
||||||
|
ENDIF(BUILD_XFCE OR BUILD_XFCE3)
|
||||||
|
123
src/gtk/thumbnailer-dbus/CMakeLists.txt
Normal file
123
src/gtk/thumbnailer-dbus/CMakeLists.txt
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
PROJECT(rp-thumbnailer-dbus)
|
||||||
|
|
||||||
|
# Find packages.
|
||||||
|
FIND_PACKAGE(GLib2 ${REQUIRE_XFCE} 2.26.0)
|
||||||
|
FIND_PACKAGE(GObject2 ${REQUIRE_XFCE} 2.26.0)
|
||||||
|
FIND_PACKAGE(GIO ${REQUIRE_XFCE} 2.26.0)
|
||||||
|
FIND_PACKAGE(GIO-UNIX ${REQUIRE_XFCE} 2.26.0)
|
||||||
|
FIND_PACKAGE(GdkPixbuf2 ${REQUIRE_XFCE})
|
||||||
|
IF(GLib2_FOUND AND GObject2_FOUND AND GIO_FOUND AND GIO-UNIX_FOUND)
|
||||||
|
# All required libraries were found.
|
||||||
|
ELSE(GLib2_FOUND AND GObject2_FOUND AND GIO_FOUND AND GIO-UNIX_FOUND)
|
||||||
|
# A required library was not found.
|
||||||
|
# Disable the D-Bus t
|
||||||
|
SET(BUILD_THUMBNAILER_DBUS OFF CACHE "" INTERNAL FORCE)
|
||||||
|
ENDIF(GLib2_FOUND AND GObject2_FOUND AND GIO_FOUND AND GIO-UNIX_FOUND)
|
||||||
|
|
||||||
|
# D-Bus bindings for the thumbnailer.
|
||||||
|
ADD_CUSTOM_COMMAND(
|
||||||
|
OUTPUT SpecializedThumbnailer1.c SpecializedThumbnailer1.h
|
||||||
|
COMMAND "${GDBUS_CODEGEN}"
|
||||||
|
--generate-c-code SpecializedThumbnailer1
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/org.freedesktop.thumbnails.SpecializedThumbnailer1.xml"
|
||||||
|
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
|
||||||
|
DEPENDS org.freedesktop.thumbnails.SpecializedThumbnailer1.xml
|
||||||
|
VERBATIM
|
||||||
|
)
|
||||||
|
|
||||||
|
SET(rp-thumbnailer-dbus_SRCS
|
||||||
|
rp-thumbnailer-dbus.cpp
|
||||||
|
rp-thumbnailer-main.cpp
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/SpecializedThumbnailer1.c
|
||||||
|
)
|
||||||
|
SET(rp-thumbnailer-dbus_H
|
||||||
|
rp-thumbnailer-dbus.hpp
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/SpecializedThumbnailer1.h
|
||||||
|
)
|
||||||
|
|
||||||
|
# Process the .service file.
|
||||||
|
INCLUDE(DirInstallPaths)
|
||||||
|
CONFIGURE_FILE(com.gerbilsoft.rom-properties.SpecializedThumbnailer1.service.in
|
||||||
|
com.gerbilsoft.rom-properties.SpecializedThumbnailer1.service)
|
||||||
|
|
||||||
|
IF(BUILD_THUMBNAILER_DBUS)
|
||||||
|
# D-Bus thumbnailer.
|
||||||
|
ADD_EXECUTABLE(rp-thumbnailer-dbus
|
||||||
|
${rp-thumbnailer-dbus_SRCS}
|
||||||
|
${rp-thumbnailer-dbus_H}
|
||||||
|
)
|
||||||
|
DO_SPLIT_DEBUG(rp-thumbnailer-dbus)
|
||||||
|
TARGET_INCLUDE_DIRECTORIES(rp-thumbnailer-dbus
|
||||||
|
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||||
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
|
||||||
|
PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
|
||||||
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/..>
|
||||||
|
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src>
|
||||||
|
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>
|
||||||
|
)
|
||||||
|
TARGET_LINK_LIBRARIES(rp-thumbnailer-dbus unixcommon)
|
||||||
|
TARGET_LINK_LIBRARIES(rp-thumbnailer-dbus GLib2::gio-unix GLib2::gio GLib2::gobject GLib2::glib)
|
||||||
|
# Link in libdl if it's required for dlopen().
|
||||||
|
IF(CMAKE_DL_LIBS)
|
||||||
|
TARGET_LINK_LIBRARIES(rp-thumbnailer-dbus ${CMAKE_DL_LIBS})
|
||||||
|
ENDIF(CMAKE_DL_LIBS)
|
||||||
|
TARGET_COMPILE_DEFINITIONS(rp-thumbnailer-dbus
|
||||||
|
PRIVATE G_LOG_DOMAIN=\"rp-thumbnailer-dbus\"
|
||||||
|
)
|
||||||
|
ENDIF(BUILD_THUMBNAILER_DBUS)
|
||||||
|
|
||||||
|
##########################################
|
||||||
|
# Install the thumbnailer D-Bus service. #
|
||||||
|
##########################################
|
||||||
|
|
||||||
|
IF(BUILD_THUMBNAILER_DBUS)
|
||||||
|
# FIXME: ${ThunarX2_EXTENSIONS_DIR} always uses the system prefix.
|
||||||
|
# This should be adjusted to ${CMAKE_INSTALL_PREFIX}.
|
||||||
|
INSTALL(TARGETS rp-thumbnailer-dbus
|
||||||
|
RUNTIME DESTINATION "${DIR_INSTALL_EXE}"
|
||||||
|
COMPONENT "plugin"
|
||||||
|
)
|
||||||
|
# TODO: Use session_bus_services_dir from dbus-1.pc.
|
||||||
|
INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/com.gerbilsoft.rom-properties.SpecializedThumbnailer1.service"
|
||||||
|
DESTINATION "share/dbus-1/services"
|
||||||
|
COMPONENT "plugin"
|
||||||
|
)
|
||||||
|
|
||||||
|
# NOTE: This file must be installed with a ".service" extension.
|
||||||
|
# NOTE 2: On Ubuntu, this must be installed in share/xfce4/thumbnailers,
|
||||||
|
# since Ubuntu ends up listing /usr/share/ in $XDG_DATA_DIRS twice,
|
||||||
|
# which causes tumblerd to load /usr/share/thumbnailers/ twice and
|
||||||
|
# fail an assertion.
|
||||||
|
|
||||||
|
# Detect Ubuntu.
|
||||||
|
# Reference: https://stackoverflow.com/questions/26919334/detect-underlying-platform-flavour-in-cmake
|
||||||
|
FIND_PROGRAM(LSB_RELEASE lsb_release)
|
||||||
|
IF(LSB_RELEASE)
|
||||||
|
EXECUTE_PROCESS(COMMAND ${LSB_RELEASE} -is
|
||||||
|
OUTPUT_VARIABLE LSB_RELEASE_ID_SHORT
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
|
)
|
||||||
|
ENDIF(LSB_RELEASE)
|
||||||
|
IF(LSB_RELEASE_ID_SHORT STREQUAL Ubuntu)
|
||||||
|
SET(THUMBNAIL_DEST_DIR "share/xfce4/thumbnailers")
|
||||||
|
ELSE()
|
||||||
|
SET(THUMBNAIL_DEST_DIR "share/thumbnailers")
|
||||||
|
ENDIF()
|
||||||
|
INSTALL(FILES "${CMAKE_CURRENT_SOURCE_DIR}/com.gerbilsoft.rom-properties.SpecializedThumbnailer1.thumbnailer"
|
||||||
|
RENAME com.gerbilsoft.rom-properties.SpecializedThumbnailer1.service
|
||||||
|
DESTINATION "${THUMBNAIL_DEST_DIR}"
|
||||||
|
COMPONENT "plugin"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Check if a split debug file should be installed.
|
||||||
|
IF(INSTALL_DEBUG)
|
||||||
|
# FIXME: Generator expression $<TARGET_PROPERTY:${_target},PDB> didn't work with CPack-3.6.1.
|
||||||
|
GET_TARGET_PROPERTY(DEBUG_FILENAME rp-thumbnailer-dbus PDB)
|
||||||
|
IF(DEBUG_FILENAME)
|
||||||
|
INSTALL(FILES "${DEBUG_FILENAME}"
|
||||||
|
DESTINATION "lib/debug/${DIR_INSTALL_EXE}"
|
||||||
|
COMPONENT "debug"
|
||||||
|
)
|
||||||
|
ENDIF(DEBUG_FILENAME)
|
||||||
|
ENDIF(INSTALL_DEBUG)
|
||||||
|
ENDIF(BUILD_THUMBNAILER_DBUS)
|
@ -1,8 +1,8 @@
|
|||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* ROM Properties Page shell extension. (GNOME) *
|
* ROM Properties Page shell extension. (D-Bus Thumbnailer) *
|
||||||
* rp-thumbnailer-dbus.cpp: D-Bus thumbnailer service. *
|
* rp-thumbnailer-dbus.cpp: D-Bus thumbnailer service. *
|
||||||
* *
|
* *
|
||||||
* Copyright (c) 2017 by David Korth. *
|
* Copyright (c) 2017-2018 by David Korth. *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify it *
|
* This program is free software; you can redistribute it and/or modify it *
|
||||||
* under the terms of the GNU General Public License as published by the *
|
* under the terms of the GNU General Public License as published by the *
|
||||||
@ -14,9 +14,8 @@
|
|||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
* GNU General Public License for more details. *
|
* GNU General Public License for more details. *
|
||||||
* *
|
* *
|
||||||
* You should have received a copy of the GNU General Public License along *
|
* You should have received a copy of the GNU General Public License *
|
||||||
* with this program; if not, write to the Free Software Foundation, Inc., *
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
@ -1,8 +1,8 @@
|
|||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* ROM Properties Page shell extension. (GNOME) *
|
* ROM Properties Page shell extension. (D-Bus Thumbnailer) *
|
||||||
* rp-thumbnailer-dbus.hpp: D-Bus thumbnailer service. *
|
* rp-thumbnailer-dbus.hpp: D-Bus thumbnailer service. *
|
||||||
* *
|
* *
|
||||||
* Copyright (c) 2017 by David Korth. *
|
* Copyright (c) 2017-2018 by David Korth. *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify it *
|
* This program is free software; you can redistribute it and/or modify it *
|
||||||
* under the terms of the GNU General Public License as published by the *
|
* under the terms of the GNU General Public License as published by the *
|
||||||
@ -14,13 +14,12 @@
|
|||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
* GNU General Public License for more details. *
|
* GNU General Public License for more details. *
|
||||||
* *
|
* *
|
||||||
* You should have received a copy of the GNU General Public License along *
|
* You should have received a copy of the GNU General Public License *
|
||||||
* with this program; if not, write to the Free Software Foundation, Inc., *
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#ifndef __ROMPROPERTIES_GTK_XFCE_RP_THUMBNAILER_DBUS_HPP__
|
#ifndef __ROMPROPERTIES_GTK_THUMBNAILER_DBUS_RP_THUMBNAILER_DBUS_HPP__
|
||||||
#define __ROMPROPERTIES_GTK_XFCE_RP_THUMBNAILER_DBUS_HPP__
|
#define __ROMPROPERTIES_GTK_THUMBNAILER_DBUS_RP_THUMBNAILER_DBUS_HPP__
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <gio/gio.h>
|
#include <gio/gio.h>
|
||||||
@ -57,4 +56,4 @@ gboolean rp_thumbnailer_is_exported (RpThumbnailer *thumbnailer);
|
|||||||
|
|
||||||
G_END_DECLS;
|
G_END_DECLS;
|
||||||
|
|
||||||
#endif /* __ROMPROPERTIES_GTK_XFCE_RP_THUMBNAILER_DBUS_HPP__ */
|
#endif /* __ROMPROPERTIES_GTK_THUMBNAILER_DBUS_RP_THUMBNAILER_DBUS_HPP__ */
|
@ -5,12 +5,10 @@ PROJECT(rom-properties-xfce)
|
|||||||
# Find packages.
|
# Find packages.
|
||||||
FIND_PACKAGE(GLib2 ${REQUIRE_XFCE} 2.26.0)
|
FIND_PACKAGE(GLib2 ${REQUIRE_XFCE} 2.26.0)
|
||||||
FIND_PACKAGE(GObject2 ${REQUIRE_XFCE} 2.26.0)
|
FIND_PACKAGE(GObject2 ${REQUIRE_XFCE} 2.26.0)
|
||||||
FIND_PACKAGE(GIO ${REQUIRE_XFCE} 2.26.0)
|
|
||||||
FIND_PACKAGE(GIO-UNIX ${REQUIRE_XFCE} 2.26.0)
|
|
||||||
FIND_PACKAGE(GdkPixbuf2 ${REQUIRE_XFCE})
|
FIND_PACKAGE(GdkPixbuf2 ${REQUIRE_XFCE})
|
||||||
# GTK2 minimum is 2.0.0, so no version check is needed.
|
# GTK2 minimum is 2.0.0, so no version check is needed.
|
||||||
FIND_PACKAGE(GTK2 ${REQUIRE_XFCE} COMPONENTS gtk)
|
FIND_PACKAGE(GTK2 ${REQUIRE_XFCE} COMPONENTS gtk)
|
||||||
IF(GLib2_FOUND AND GObject2_FOUND AND GIO_FOUND AND GIO-UNIX_FOUND AND GdkPixbuf2_FOUND AND GTK2_FOUND)
|
IF(GLib2_FOUND AND GObject2_FOUND AND GdkPixbuf2_FOUND AND GTK2_FOUND)
|
||||||
# Find the ThunarX 2 library.
|
# Find the ThunarX 2 library.
|
||||||
FIND_PACKAGE(ThunarX2 ${REQUIRE_XFCE})
|
FIND_PACKAGE(ThunarX2 ${REQUIRE_XFCE})
|
||||||
IF(NOT ThunarX2_FOUND)
|
IF(NOT ThunarX2_FOUND)
|
||||||
@ -18,11 +16,11 @@ IF(GLib2_FOUND AND GObject2_FOUND AND GIO_FOUND AND GIO-UNIX_FOUND AND GdkPixbuf
|
|||||||
# Disable the XFCE frontend.
|
# Disable the XFCE frontend.
|
||||||
SET(BUILD_XFCE OFF CACHE "" INTERNAL FORCE)
|
SET(BUILD_XFCE OFF CACHE "" INTERNAL FORCE)
|
||||||
ENDIF(NOT ThunarX2_FOUND)
|
ENDIF(NOT ThunarX2_FOUND)
|
||||||
ELSE(GLib2_FOUND AND GObject2_FOUND AND GIO_FOUND AND GIO-UNIX_FOUND AND GdkPixbuf2_FOUND AND GTK2_FOUND)
|
ELSE(GLib2_FOUND AND GObject2_FOUND AND GdkPixbuf2_FOUND AND GTK2_FOUND)
|
||||||
# GTK+ 2.x (or required dependencies) were not found.
|
# GTK+ 2.x (or required dependencies) were not found.
|
||||||
# Disable the XFCE frontend.
|
# Disable the XFCE frontend.
|
||||||
SET(BUILD_XFCE OFF CACHE "" INTERNAL FORCE)
|
SET(BUILD_XFCE OFF CACHE "" INTERNAL FORCE)
|
||||||
ENDIF(GLib2_FOUND AND GObject2_FOUND AND GIO_FOUND AND GIO-UNIX_FOUND AND GdkPixbuf2_FOUND AND GTK2_FOUND)
|
ENDIF(GLib2_FOUND AND GObject2_FOUND AND GdkPixbuf2_FOUND AND GTK2_FOUND)
|
||||||
|
|
||||||
# Sources and headers. (GTK+ common)
|
# Sources and headers. (GTK+ common)
|
||||||
STRING(REGEX REPLACE "([^;]+)" "../\\1" rom-properties-xfce_SRCS "${rom-properties-gtk_SRCS}")
|
STRING(REGEX REPLACE "([^;]+)" "../\\1" rom-properties-xfce_SRCS "${rom-properties-gtk_SRCS}")
|
||||||
@ -65,32 +63,6 @@ SET(rom-properties-xfce_H
|
|||||||
rom-properties-page.hpp
|
rom-properties-page.hpp
|
||||||
)
|
)
|
||||||
|
|
||||||
# D-Bus bindings for the thumbnailer.
|
|
||||||
ADD_CUSTOM_COMMAND(
|
|
||||||
OUTPUT SpecializedThumbnailer1.c SpecializedThumbnailer1.h
|
|
||||||
COMMAND "${GDBUS_CODEGEN}"
|
|
||||||
--generate-c-code SpecializedThumbnailer1
|
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/org.freedesktop.thumbnails.SpecializedThumbnailer1.xml"
|
|
||||||
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
|
|
||||||
DEPENDS org.freedesktop.thumbnails.SpecializedThumbnailer1.xml
|
|
||||||
VERBATIM
|
|
||||||
)
|
|
||||||
|
|
||||||
SET(rp-thumbnailer-dbus_SRCS
|
|
||||||
rp-thumbnailer-dbus.cpp
|
|
||||||
rp-thumbnailer-main.cpp
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/SpecializedThumbnailer1.c
|
|
||||||
)
|
|
||||||
SET(rp-thumbnailer-dbus_H
|
|
||||||
rp-thumbnailer-dbus.hpp
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/SpecializedThumbnailer1.h
|
|
||||||
)
|
|
||||||
|
|
||||||
# Process the .service file.
|
|
||||||
INCLUDE(DirInstallPaths)
|
|
||||||
CONFIGURE_FILE(com.gerbilsoft.rom-properties.SpecializedThumbnailer1.service.in
|
|
||||||
com.gerbilsoft.rom-properties.SpecializedThumbnailer1.service)
|
|
||||||
|
|
||||||
IF(BUILD_XFCE)
|
IF(BUILD_XFCE)
|
||||||
ADD_LIBRARY(rom-properties-xfce MODULE
|
ADD_LIBRARY(rom-properties-xfce MODULE
|
||||||
${rom-properties-xfce_SRCS}
|
${rom-properties-xfce_SRCS}
|
||||||
@ -119,30 +91,6 @@ IF(BUILD_XFCE)
|
|||||||
TARGET_COMPILE_DEFINITIONS(rom-properties-xfce
|
TARGET_COMPILE_DEFINITIONS(rom-properties-xfce
|
||||||
PRIVATE G_LOG_DOMAIN=\"rom-properties-xfce\"
|
PRIVATE G_LOG_DOMAIN=\"rom-properties-xfce\"
|
||||||
)
|
)
|
||||||
|
|
||||||
# D-Bus thumbnailer.
|
|
||||||
ADD_EXECUTABLE(rp-thumbnailer-dbus
|
|
||||||
${rp-thumbnailer-dbus_SRCS}
|
|
||||||
${rp-thumbnailer-dbus_H}
|
|
||||||
)
|
|
||||||
DO_SPLIT_DEBUG(rp-thumbnailer-dbus)
|
|
||||||
TARGET_INCLUDE_DIRECTORIES(rp-thumbnailer-dbus
|
|
||||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
|
|
||||||
PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
|
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/..>
|
|
||||||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src>
|
|
||||||
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>
|
|
||||||
)
|
|
||||||
TARGET_LINK_LIBRARIES(rp-thumbnailer-dbus unixcommon)
|
|
||||||
TARGET_LINK_LIBRARIES(rp-thumbnailer-dbus GLib2::gio-unix GLib2::gio GLib2::gobject GLib2::glib)
|
|
||||||
# Link in libdl if it's required for dlopen().
|
|
||||||
IF(CMAKE_DL_LIBS)
|
|
||||||
TARGET_LINK_LIBRARIES(rp-thumbnailer-dbus ${CMAKE_DL_LIBS})
|
|
||||||
ENDIF(CMAKE_DL_LIBS)
|
|
||||||
TARGET_COMPILE_DEFINITIONS(rp-thumbnailer-dbus
|
|
||||||
PRIVATE G_LOG_DOMAIN=\"rp-thumbnailer-dbus\"
|
|
||||||
)
|
|
||||||
ENDIF(BUILD_XFCE)
|
ENDIF(BUILD_XFCE)
|
||||||
|
|
||||||
#######################
|
#######################
|
||||||
@ -156,41 +104,6 @@ IF(BUILD_XFCE)
|
|||||||
LIBRARY DESTINATION "${ThunarX2_EXTENSIONS_DIR}"
|
LIBRARY DESTINATION "${ThunarX2_EXTENSIONS_DIR}"
|
||||||
COMPONENT "plugin"
|
COMPONENT "plugin"
|
||||||
)
|
)
|
||||||
INSTALL(TARGETS rp-thumbnailer-dbus
|
|
||||||
RUNTIME DESTINATION "${DIR_INSTALL_EXE}"
|
|
||||||
COMPONENT "plugin"
|
|
||||||
)
|
|
||||||
# TODO: Use session_bus_services_dir from dbus-1.pc.
|
|
||||||
INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/com.gerbilsoft.rom-properties.SpecializedThumbnailer1.service"
|
|
||||||
DESTINATION "share/dbus-1/services"
|
|
||||||
COMPONENT "plugin"
|
|
||||||
)
|
|
||||||
|
|
||||||
# NOTE: This file must be installed with a ".service" extension.
|
|
||||||
# NOTE 2: On Ubuntu, this must be installed in share/xfce4/thumbnailers,
|
|
||||||
# since Ubuntu ends up listing /usr/share/ in $XDG_DATA_DIRS twice,
|
|
||||||
# which causes tumblerd to load /usr/share/thumbnailers/ twice and
|
|
||||||
# fail an assertion.
|
|
||||||
|
|
||||||
# Detect Ubuntu.
|
|
||||||
# Reference: https://stackoverflow.com/questions/26919334/detect-underlying-platform-flavour-in-cmake
|
|
||||||
FIND_PROGRAM(LSB_RELEASE lsb_release)
|
|
||||||
IF(LSB_RELEASE)
|
|
||||||
EXECUTE_PROCESS(COMMAND ${LSB_RELEASE} -is
|
|
||||||
OUTPUT_VARIABLE LSB_RELEASE_ID_SHORT
|
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
||||||
)
|
|
||||||
ENDIF(LSB_RELEASE)
|
|
||||||
IF(LSB_RELEASE_ID_SHORT STREQUAL Ubuntu)
|
|
||||||
SET(THUMBNAIL_DEST_DIR "share/xfce4/thumbnailers")
|
|
||||||
ELSE()
|
|
||||||
SET(THUMBNAIL_DEST_DIR "share/thumbnailers")
|
|
||||||
ENDIF()
|
|
||||||
INSTALL(FILES "${CMAKE_CURRENT_SOURCE_DIR}/com.gerbilsoft.rom-properties.SpecializedThumbnailer1.thumbnailer"
|
|
||||||
RENAME com.gerbilsoft.rom-properties.SpecializedThumbnailer1.service
|
|
||||||
DESTINATION "${THUMBNAIL_DEST_DIR}"
|
|
||||||
COMPONENT "plugin"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Check if a split debug file should be installed.
|
# Check if a split debug file should be installed.
|
||||||
IF(INSTALL_DEBUG)
|
IF(INSTALL_DEBUG)
|
||||||
@ -202,13 +115,5 @@ IF(BUILD_XFCE)
|
|||||||
COMPONENT "debug"
|
COMPONENT "debug"
|
||||||
)
|
)
|
||||||
ENDIF(DEBUG_FILENAME)
|
ENDIF(DEBUG_FILENAME)
|
||||||
|
|
||||||
GET_TARGET_PROPERTY(DEBUG_FILENAME rp-thumbnailer-dbus PDB)
|
|
||||||
IF(DEBUG_FILENAME)
|
|
||||||
INSTALL(FILES "${DEBUG_FILENAME}"
|
|
||||||
DESTINATION "lib/debug/${DIR_INSTALL_EXE}"
|
|
||||||
COMPONENT "debug"
|
|
||||||
)
|
|
||||||
ENDIF(DEBUG_FILENAME)
|
|
||||||
ENDIF(INSTALL_DEBUG)
|
ENDIF(INSTALL_DEBUG)
|
||||||
ENDIF(BUILD_XFCE)
|
ENDIF(BUILD_XFCE)
|
||||||
|
Loading…
Reference in New Issue
Block a user