summaryrefslogtreecommitdiffstats
path: root/cmake/modules/FindFriBidi.cmake
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 18:07:22 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 18:07:22 +0000
commitc04dcc2e7d834218ef2d4194331e383402495ae1 (patch)
tree7333e38d10d75386e60f336b80c2443c1166031d /cmake/modules/FindFriBidi.cmake
parentInitial commit. (diff)
downloadkodi-c04dcc2e7d834218ef2d4194331e383402495ae1.tar.xz
kodi-c04dcc2e7d834218ef2d4194331e383402495ae1.zip
Adding upstream version 2:20.4+dfsg.upstream/2%20.4+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'cmake/modules/FindFriBidi.cmake')
-rw-r--r--cmake/modules/FindFriBidi.cmake52
1 files changed, 52 insertions, 0 deletions
diff --git a/cmake/modules/FindFriBidi.cmake b/cmake/modules/FindFriBidi.cmake
new file mode 100644
index 0000000..65e543a
--- /dev/null
+++ b/cmake/modules/FindFriBidi.cmake
@@ -0,0 +1,52 @@
+#.rst:
+# FindFribidi
+# -----------
+# Finds the GNU FriBidi library
+#
+# This will define the following variables::
+#
+# FRIBIDI_FOUND - system has FriBidi
+# FRIBIDI_INCLUDE_DIRS - the FriBidi include directory
+# FRIBIDI_LIBRARIES - the FriBidi libraries
+#
+# and the following imported targets::
+#
+# FriBidi::FriBidi - The FriBidi library
+
+if(PKG_CONFIG_FOUND)
+ pkg_check_modules(PC_FRIBIDI fribidi QUIET)
+endif()
+
+find_path(FRIBIDI_INCLUDE_DIR NAMES fribidi.h
+ PATH_SUFFIXES fribidi
+ PATHS ${PC_FRIBIDI_INCLUDEDIR})
+find_library(FRIBIDI_LIBRARY NAMES fribidi libfribidi
+ PATHS ${PC_FRIBIDI_LIBDIR})
+
+set(FRIBIDI_VERSION ${PC_FRIBIDI_VERSION})
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(FriBidi
+ REQUIRED_VARS FRIBIDI_LIBRARY FRIBIDI_INCLUDE_DIR
+ VERSION_VAR FRIBIDI_VERSION)
+
+if(FRIBIDI_FOUND)
+ set(FRIBIDI_LIBRARIES ${FRIBIDI_LIBRARY})
+ set(FRIBIDI_INCLUDE_DIRS ${FRIBIDI_INCLUDE_DIR})
+ if(PC_FRIBIDI_INCLUDE_DIRS)
+ list(APPEND FRIBIDI_INCLUDE_DIRS ${PC_FRIBIDI_INCLUDE_DIRS})
+ endif()
+ if(PC_FRIBIDI_CFLAGS_OTHER)
+ set(FRIBIDI_DEFINITIONS ${PC_FRIBIDI_CFLAGS_OTHER})
+ endif()
+
+ if(NOT TARGET FriBidi::FriBidi)
+ add_library(FriBidi::FriBidi UNKNOWN IMPORTED)
+ set_target_properties(FriBidi::FriBidi PROPERTIES
+ IMPORTED_LOCATION "${FRIBIDI_LIBRARY}"
+ INTERFACE_INCLUDE_DIRECTORIES "${FRIBIDI_INCLUDE_DIRS}"
+ INTERFACE_COMPILE_OPTIONS "${FRIBIDI_DEFINITIONS}")
+ endif()
+endif()
+
+mark_as_advanced(FRIBIDI_INCLUDE_DIR FRIBIDI_LIBRARY)