rom-properties/cmake/libs/FindThunarX2.cmake
David Korth e1e0f43f84 [cmake] Prepend ${CMAKE_INSTALL_PREFIX} to the default extension directories.
This seems to be needed on Ubuntu 14.04 for Thunar (GTK+ 2.x).

Newer versions have the extension directory defined in the pkgconfig
file, so it's not an issue there.
2020-02-18 20:31:08 -05:00

32 lines
1.2 KiB
CMake

# Find ThunarX libraries and headers. (GTK+ 2.x version)
# If found, the following variables will be defined:
# - ThunarX2_FOUND: System has ThunarX.
# - ThunarX2_INCLUDE_DIRS: ThunarX include directories.
# - ThunarX2_LIBRARIES: ThunarX libraries.
# - ThunarX2_DEFINITIONS: Compiler switches required for using ThunarX.
# - ThunarX2_EXTENSIONS_DIR: Extensions directory. (for installation)
#
# In addition, a target Xfce::thunarx-2 will be created with all of
# these definitions.
#
# References:
# - https://cmake.org/Wiki/CMake:How_To_Find_Libraries
# - http://francesco-cek.com/cmake-and-gtk-3-the-easy-way/
#
# TODO: Replace package prefix with CMAKE_INSTALL_PREFIX.
INCLUDE(FindLibraryPkgConfig)
FIND_LIBRARY_PKG_CONFIG(ThunarX2
thunarx-2 # pkgconfig
thunarx/thunarx.h # header
thunarx-2 # library
Xfce::thunarx-2 # imported target
)
# Extensions directory.
IF(ThunarX2_FOUND AND NOT ThunarX2_EXTENSIONS_DIR)
MESSAGE(WARNING "ThunarX2_EXTENSIONS_DIR is not set; using defaults.")
INCLUDE(DirInstallPaths)
SET(ThunarX2_EXTENSIONS_DIR "${CMAKE_INSTALL_PREFIX}/${DIR_INSTALL_LIB}/thunarx-2" CACHE INTERNAL "ThunarX2_EXTENSIONS_DIR")
ENDIF(ThunarX2_FOUND AND NOT ThunarX2_EXTENSIONS_DIR)