blob: d23d9f404133f68719bc4e5a40031ef0bf53e07e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
--- k9copy/cmake/FindAvformat.cmake.orig 2014-09-29 16:00:12.000000000 +0100
+++ k9copy/cmake/FindAvformat.cmake 2015-05-28 19:42:03.942426473 +0100
@@ -1,33 +1,35 @@
-# - Try to find LibAvformat
-# Once done this will define
-# LIBAVFORMAT_FOUND - System has LibAvformat
-# LIBAVFORMAT_INCLUDE_DIRS - The LibAvformat include directories
-# LIBAVFORMAT_LIBRARIES - The libraries needed to use LibAvformat
-# LIBAVFORMAT_DEFINITIONS - Compiler switches required for using LibAvformat
-
-#find_package(PkgConfig)
-#pkg_check_modules(PC_LIBAVFORMAT QUIET libAvFormat)
-#set(LIBAVFORMAT_DEFINITIONS ${PC_LIBAVFORMAT_CFLAGS_OTHER})
-
-#find_path(LIBAVFORMAT_INCLUDE_DIR ffmpeg/libAvformat/avformat.h
-# HINTS ${PC_LIBAVFORMAT_INCLUDEDIR} ${PC_LIBAVFORMAT_INCLUDE_DIRS}
-# PATH_SUFFIXES ffmpeg )
-
-#find_library(LIBAVFORMAT_LIBRARY NAMES libavformat libAvFormat LibAvformat
-# HINTS ${PC_LIBAVFORMAT_LIBDIR} ${PC_LIBAVFORMAT_LIBRARY_DIRS} )
-
-#set(LIBAVFORMAT_LIBRARIES ${LIBAVFORMAT_LIBRARY} )
-#set(LIBAVFORMAT_INCLUDE_DIRS ${LIBAVFORMAT_INCLUDE_DIR} )
-
-#include(FindPackageHandleStandardArgs)
-# handle the QUIETLY and REQUIRED arguments and set LIBAVFORMAT_FOUND to TRUE
-# if all listed variables are TRUE
-#find_package_handle_standard_args(LibAvformat DEFAULT_MSG
-# LIBAVFORMAT_LIBRARY LIBAVFORMAT_INCLUDE_DIR)
-
-#mark_as_advanced(LIBAVFORMAT_INCLUDE_DIR LIBAVFORMAT_LIBRARY )
-
-
-INCLUDE(FindPkgConfig)
-PKG_SEARCH_MODULE(LIBAVFORMAT REQUIRED libavformat)
-INCLUDE_DIRECTORIES(${LIBAVFORMAT_INCLUDE_DIRS})
+MACRO (FINDAVFORMAT _lib)
+
+FIND_PATH(AVFORMAT_INCLUDE_DIR_FF "ffmpeg/avformat.h" PATHS)
+IF (AVFORMAT_INCLUDE_DIR_FF)
+ SET (AVFORMAT_INCLUDE_DIR "${AVCODEC_INCLUDE_DIR_FF}/ffmpeg")
+ELSE (AVFORMAT_INCLUDE_DIR_FF)
+ FIND_PATH(AVFORMAT_INCLUDE_DIR_LAVC "libavformat/avformat.h" PATHS)
+ IF (AVFORMAT_INCLUDE_DIR_LAVC)
+ SET (AVFORMAT_INCLUDE_DIR "${AVFORMAT_INCLUDE_DIR_LAVC}/libavformat")
+ ELSE (AVFORMAT_INCLUDE_DIR_LAVC)
+ FIND_PATH(AVFORMAT_INCLUDE_DIR_FF_LAVF "ffmpeg/libavformat/avformat.h" PATHS)
+ IF (AVFORMAT_INCLUDE_DIR_FF_LAVF)
+ SET (AVFORMAT_INCLUDE_DIR "${AVFORMAT_INCLUDE_DIR_FF_LAVF}/ffmpeg/libavformat")
+ ENDIF (AVFORMAT_INCLUDE_DIR_FF_LAVF)
+ ENDIF (AVFORMAT_INCLUDE_DIR_LAVC)
+ENDIF (AVFORMAT_INCLUDE_DIR_FF)
+
+
+
+FIND_LIBRARY(AVFORMAT_LIBRARY NAMES ${_lib} PATHS )
+
+IF (AVFORMAT_INCLUDE_DIR AND AVFORMAT_LIBRARY)
+ SET(INC_FOUND TRUE)
+ELSE (AVFORMAT_INCLUDE_DIR AND AVFORMAT_LIBRARY)
+ SET(INC_FOUND FALSE)
+ENDIF (AVFORMAT_INCLUDE_DIR AND AVFORMAT_LIBRARY)
+
+
+IF (INC_FOUND)
+ MESSAGE(STATUS "Found include avformat.h: ${AVFORMAT_INCLUDE_DIR}")
+ MESSAGE(STATUS "Found library ${_lib}: ${AVFORMAT_LIBRARY}")
+ELSE (INC_FOUND)
+ MESSAGE(FATAL_ERROR "Could not find ${_lib}")
+ENDIF (INC_FOUND)
+ENDMACRO (FINDAVFORMAT _lib )
\ No newline at end of file
|