Added pkg-config to cmake OpenH264 detection.
authorArmin Novak <armin.novak@thincast.com>
Wed, 10 May 2017 10:35:20 +0000 (12:35 +0200)
committerArmin Novak <armin.novak@thincast.com>
Wed, 10 May 2017 10:35:20 +0000 (12:35 +0200)
cmake/FindOpenH264.cmake

index 404c8b6..2efe2cd 100644 (file)
@@ -7,17 +7,22 @@
 #  OPENH264_INCLUDE_DIR - the OpenH264 include directory
 #  OPENH264_LIBRARIES - libopenh264 library
 
+if (UNIX AND NOT ANDROID)
+  find_package(PkgConfig QUIET)
+  pkg_check_modules(PC_OPENH264 QUIET openh264)
+endif (UNIX AND NOT ANDROID)
+
 if (OPENH264_INCLUDE_DIR AND OPENH264_LIBRARY)
        set(OPENH264_FIND_QUIETLY TRUE)
 endif (OPENH264_INCLUDE_DIR AND OPENH264_LIBRARY)
 
 find_path(OPENH264_INCLUDE_DIR NAMES wels/codec_api.h wels/codec_app_def.h wels/codec_def.h 
        PATH_SUFFIXES include
-       HINTS ${OPENH264_ROOT})
+       HINTS ${OPENH264_ROOT} ${PC_OPENH264_INCLUDE_DIRS})
 find_library(OPENH264_LIBRARY
         NAMES openh264_dll openh264 welsdec
         PATH_SUFFIXES lib
-        HINTS ${OPENH264_ROOT})
+        HINTS ${OPENH264_ROOT} ${PC_OPENH264_LIBRARY_DIRS})
 
 include(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenH264 DEFAULT_MSG OPENH264_LIBRARY OPENH264_INCLUDE_DIR)