Skip to content

Commit

Permalink
added avresample cmake module
Browse files Browse the repository at this point in the history
  • Loading branch information
nieknooijens committed Dec 2, 2014
1 parent 1a20d41 commit 16f735b
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions cmake/FindAVResample.cmake
@@ -0,0 +1,44 @@
# - Try to find libav libavresample
# Once done, this will define
#
# AVResample_FOUND - the library is available
# AVResample_INCLUDE_DIRS - the include directories
# AVResample_LIBRARIES - the libraries
# AVResample_INCLUDE - the file to #include (may be used in config.h)
#
# See documentation on how to write CMake scripts at
# http://www.cmake.org/Wiki/CMake:How_To_Find_Libraries

include(LibFindMacros)

libfind_package(AVResample AVUtil)



libfind_pkg_check_modules(AVResample_PKGCONF libavresample)

find_path(AVResample_INCLUDE_DIR
NAMES libavresample/avresample.h ffmpeg/avresample.h avresample.h
PATHS ${AVResample_PKGCONF_INCLUDE_DIRS}
PATH_SUFFIXES ffmpeg
)
if(AVResample_INCLUDE_DIR)
foreach(suffix libavresample/ ffmpeg/ "")
if(NOT AVResample_INCLUDE)
if(EXISTS "${AVResample_INCLUDE_DIR}/${suffix}avresample.h")
set(AVResample_INCLUDE "${suffix}avresample.h")
endif(EXISTS "${AVResample_INCLUDE_DIR}/${suffix}avresample.h")
endif(NOT AVResample_INCLUDE)
endforeach(suffix)

if(NOT AVResample_INCLUDE)
message(FATAL_ERROR "Found avresample.h include dir, but not the header file. Perhaps you need to clear CMake cache?")
endif(NOT AVResample_INCLUDE)
endif(AVResample_INCLUDE_DIR)

find_library(AVResample_LIBRARY
NAMES libavresample.dll.a avresample
PATHS ${AVResample_PKGCONF_LIBRARY_DIRS}
)

libfind_process(AVResample)

0 comments on commit 16f735b

Please sign in to comment.