rom-properties/cmake/libs/FindLibNemoExtension.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

31 lines
1.3 KiB
CMake

# Find Cinnamon's libnemo-extension libraries and headers.
# If found, the following variables will be defined:
# - LibNemoExtension_FOUND: System has libnemo-extension.
# - LibNemoExtension_INCLUDE_DIRS: libnemo-extension include directories.
# - LibNemoExtension_LIBRARIES: libnemo-extension libraries.
# - LibNemoExtension_DEFINITIONS: Compiler switches required for using libnemo-extension.
# - LibNemoExtension_EXTENSION_DIR: Extensions directory. (for installation)
#
# In addition, a target Cinnamon::libnemo-extension 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/
#
INCLUDE(FindLibraryPkgConfig)
FIND_LIBRARY_PKG_CONFIG(LibNemoExtension
libnemo-extension # pkgconfig
libnemo-extension/nemo-extension-types.h # header
nemo-extension # library
Cinnamon::libnemo-extension # imported target
)
# Extensions directory.
IF(LibNemoExtension_FOUND AND NOT LibNemoExtension_EXTENSION_DIR)
MESSAGE(WARNING "LibNemoExtension_EXTENSION_DIR is not set; using defaults.")
INCLUDE(DirInstallPaths)
SET(LibNemoExtension_EXTENSION_DIR "${CMAKE_INSTALL_PREFIX}/${DIR_INSTALL_LIB}/nemo/extensions-3.0" CACHE INTERNAL "LibNemoExtension_EXTENSION_DIR")
ENDIF(LibNemoExtension_FOUND AND NOT LibNemoExtension_EXTENSION_DIR)