summaryrefslogtreecommitdiffstats
path: root/project/cmake/modules/FindPlist.cmake
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2016-03-08 21:02:53 +0100
committermanuel <manuel@mausz.at>2016-03-08 21:02:53 +0100
commit9fc8b732737f139d3e466510d75668ab45578960 (patch)
tree76db9bf5cb8cc869be908a5ed3d6f4cca3e3608a /project/cmake/modules/FindPlist.cmake
parentb75e2659df11c23aa921d2eed83c23adc282ed27 (diff)
downloadkodi-pvr-build-9fc8b732737f139d3e466510d75668ab45578960.tar.gz
kodi-pvr-build-9fc8b732737f139d3e466510d75668ab45578960.tar.bz2
kodi-pvr-build-9fc8b732737f139d3e466510d75668ab45578960.zip
sync with upstream
Diffstat (limited to 'project/cmake/modules/FindPlist.cmake')
-rw-r--r--project/cmake/modules/FindPlist.cmake58
1 files changed, 58 insertions, 0 deletions
diff --git a/project/cmake/modules/FindPlist.cmake b/project/cmake/modules/FindPlist.cmake
new file mode 100644
index 0000000..d7a6c48
--- /dev/null
+++ b/project/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)