summaryrefslogtreecommitdiffstats
path: root/cmake/modules/FindPlist.cmake
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2017-06-04 16:57:49 +0200
committermanuel <manuel@mausz.at>2017-06-04 16:57:49 +0200
commitf44ecaa4f27e7538ddcad66d40e543bffa2d2d86 (patch)
treed8de60fc7e17edeb6f0921726c038ee54b281445 /cmake/modules/FindPlist.cmake
parentae08c8b7221bc965ac40d70e53fc8fcddb050c46 (diff)
downloadkodi-pvr-build-f44ecaa4f27e7538ddcad66d40e543bffa2d2d86.tar.gz
kodi-pvr-build-f44ecaa4f27e7538ddcad66d40e543bffa2d2d86.tar.bz2
kodi-pvr-build-f44ecaa4f27e7538ddcad66d40e543bffa2d2d86.zip
sync with upstream
Diffstat (limited to 'cmake/modules/FindPlist.cmake')
-rw-r--r--cmake/modules/FindPlist.cmake58
1 files changed, 58 insertions, 0 deletions
diff --git a/cmake/modules/FindPlist.cmake b/cmake/modules/FindPlist.cmake
new file mode 100644
index 0000000..862da46
--- /dev/null
+++ b/cmake/modules/FindPlist.cmake
@@ -0,0 +1,58 @@
1#.rst:
2# FindPlist
3# ---------
4# Finds the Plist library
5#
6# This will will define the following variables::
7#
8# PLIST_FOUND - system has Plist library
9# PLIST_INCLUDE_DIRS - the Plist library include directory
10# PLIST_LIBRARIES - the Plist libraries
11# PLIST_DEFINITIONS - the Plist compile definitions
12#
13# and the following imported targets::
14#
15# Plist::Plist - The Plist library
16
17if(PKG_CONFIG_FOUND)
18 pkg_check_modules(PC_PLIST libplist QUIET)
19endif()
20
21find_path(PLIST_INCLUDE_DIR plist/plist.h
22 PATHS ${PC_PLIST_INCLUDEDIR})
23
24set(PLIST_VERSION ${PC_PLIST_VERSION})
25
26include(FindPackageHandleStandardArgs)
27if(NOT WIN32)
28 find_library(PLIST_LIBRARY NAMES plist
29 PATHS ${PC_PLIST_LIBDIR})
30
31 find_package_handle_standard_args(Plist
32 REQUIRED_VARS PLIST_LIBRARY PLIST_INCLUDE_DIR
33 VERSION_VAR PLIST_VERSION)
34else()
35 # Dynamically loaded DLL
36 find_package_handle_standard_args(Plist
37 REQUIRED_VARS PLIST_INCLUDE_DIR
38 VERSION_VAR PLIST_VERSION)
39endif()
40
41if(PLIST_FOUND)
42 set(PLIST_LIBRARIES ${PLIST_LIBRARY})
43 set(PLIST_INCLUDE_DIRS ${PLIST_INCLUDE_DIR})
44 set(PLIST_DEFINITIONS -DHAVE_LIBPLIST=1)
45
46 if(NOT TARGET Plist::Plist)
47 add_library(Plist::Plist UNKNOWN IMPORTED)
48 if(PLIST_LIBRARY)
49 set_target_properties(Plist::Plist PROPERTIES
50 IMPORTED_LOCATION "${PLIST_LIBRARY}")
51 endif()
52 set_target_properties(Plist::Plist PROPERTIES
53 INTERFACE_INCLUDE_DIRECTORIES "${PLIST_INCLUDE_DIR}"
54 INTERFACE_COMPILE_DEFINITIONS HAVE_LIBPLIST=1)
55 endif()
56endif()
57
58mark_as_advanced(PLIST_INCLUDE_DIR PLIST_LIBRARY)