Skip to content

Commit

Permalink
Fallback to old FindFFMpeg script when pkg-config fails.
Browse files Browse the repository at this point in the history
This should work better on Windows, hopefully. It worked well
enough when I intentionally broke pkg-config, anyway.
  • Loading branch information
QuLogic committed Aug 30, 2010
1 parent 5d6298b commit dde985e
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,10 @@ ENDIF(ENABLE_SOUND)
ENDIF ()

IF(ENABLE_LIBAVCODEC)
pkg_check_modules(FFMPEG REQUIRED libavcodec)
pkg_check_modules(FFMPEG libavcodec)
IF(NOT(FFMPEG_FOUND))
INCLUDE(FindFFMpeg REQUIRED)
ENDIF(NOT(FFMPEG_FOUND))
# Compatibility checks for ffmpeg deprecated functions
INCLUDE(CheckFunctionExists REQUIRED)
SET(CMAKE_REQUIRED_FLAGS ${LIBAVCODEC_CFLAGS})
Expand Down
33 changes: 33 additions & 0 deletions conf/FindFFMpeg.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# - Find libavcodec (FFMPEG)
# Find the native FFMPEG headers and libraries.
# Only grabs what Lightspark needs currently
#
# FFMPEG_INCLUDE_DIRS - where to find avcodec.h
# FFMPEG_LIBRARIES - List of libraries when using ffmpeg
# FFMPEG_FOUND - True if ffmpeg found.

# Look for the header file.
FIND_PATH(FFMPEG_INCLUDE_DIR NAMES libavcodec/avcodec.h PATH_SUFFIXES ffmpeg)
MARK_AS_ADVANCED(FFMPEG_INCLUDE_DIR)

# Look for the library.
FIND_LIBRARY(FFMPEG_AVCODEC_LIBRARY NAMES
avcodec
)

FIND_LIBRARY(FFMPEG_AVUTIL_LIBRARY NAMES
avutil
)

SET(FFMPEG_LIBRARY ${FFMPEG_AVCODEC_LIBRARY} ${FFMPEG_AVUTIL_LIBRARY})
MARK_AS_ADVANCED(FFMPEG_LIBRARY)

# handle the QUIETLY and REQUIRED arguments and set FFMPEG_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(FFMPEG DEFAULT_MSG FFMPEG_LIBRARY FFMPEG_INCLUDE_DIR)

IF(FFMPEG_FOUND)
SET(FFMPEG_LIBRARIES ${FFMPEG_LIBRARY})
SET(FFMPEG_INCLUDE_DIRS ${FFMPEG_INCLUDE_DIR})
ENDIF(FFMPEG_FOUND)

0 comments on commit dde985e

Please sign in to comment.