2014-01-20 07:58:58 -08:00
|
|
|
# Once done these will be defined:
|
|
|
|
#
|
2014-05-21 22:50:56 -07:00
|
|
|
# LIBX264_FOUND
|
|
|
|
# LIBX264_INCLUDE_DIRS
|
|
|
|
# LIBX264_LIBRARIES
|
2014-01-20 07:58:58 -08:00
|
|
|
#
|
2014-07-18 22:23:44 -07:00
|
|
|
# For use in OBS:
|
|
|
|
#
|
|
|
|
# X264_INCLUDE_DIR
|
|
|
|
#
|
2014-01-20 07:58:58 -08:00
|
|
|
|
2014-05-21 22:50:56 -07:00
|
|
|
if(LIBX264_INCLUDE_DIRS AND LIBX264_LIBRARIES)
|
|
|
|
set(LIBX264_FOUND TRUE)
|
2014-01-20 07:58:58 -08:00
|
|
|
else()
|
|
|
|
find_package(PkgConfig QUIET)
|
|
|
|
if (PKG_CONFIG_FOUND)
|
|
|
|
pkg_check_modules(_X264 QUIET x264)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
|
|
set(_lib_suffix 64)
|
|
|
|
else()
|
|
|
|
set(_lib_suffix 32)
|
|
|
|
endif()
|
|
|
|
|
2014-07-18 20:05:42 -07:00
|
|
|
set(X264_PATH_ARCH x264Path${_lib_suffix})
|
|
|
|
set(FFMPEG_PATH_ARCH FFmpegPath${_lib_suffix})
|
|
|
|
|
2014-01-20 07:58:58 -08:00
|
|
|
find_path(X264_INCLUDE_DIR
|
|
|
|
NAMES x264.h
|
|
|
|
HINTS
|
2014-07-28 16:46:30 -07:00
|
|
|
${_X264_INCLUDE_DIRS}
|
2014-07-15 19:36:45 -07:00
|
|
|
"${CMAKE_SOURCE_DIR}/additional_install_files/include"
|
|
|
|
"$ENV{obsAdditionalInstallFiles}/include"
|
2014-01-20 07:58:58 -08:00
|
|
|
ENV x264Path
|
2014-05-21 22:50:56 -07:00
|
|
|
ENV FFmpegPath
|
2014-07-18 20:05:42 -07:00
|
|
|
ENV ${X264_PATH_ARCH}
|
|
|
|
ENV ${FFMPEG_PATH_ARCH}
|
2014-07-28 16:46:30 -07:00
|
|
|
PATHS
|
2014-01-20 07:58:58 -08:00
|
|
|
/usr/include /usr/local/include /opt/local/include /sw/include)
|
|
|
|
|
|
|
|
find_library(X264_LIB
|
2014-07-28 16:46:30 -07:00
|
|
|
NAMES ${_X264_LIBRARIES} x264 libx264
|
2014-07-15 19:36:45 -07:00
|
|
|
HINTS
|
2014-07-28 16:46:30 -07:00
|
|
|
${_X264_LIBRARY_DIRS}
|
2014-07-15 19:36:45 -07:00
|
|
|
"${X264_INCLUDE_DIR}/../lib"
|
|
|
|
"${X264_INCLUDE_DIR}/../lib${_lib_suffix}"
|
|
|
|
"${X264_INCLUDE_DIR}/../libs${_lib_suffix}"
|
2014-07-18 20:05:42 -07:00
|
|
|
"${X264_INCLUDE_DIR}/lib"
|
2014-07-15 19:36:45 -07:00
|
|
|
"${X264_INCLUDE_DIR}/lib${_lib_suffix}"
|
2014-07-28 16:46:30 -07:00
|
|
|
PATHS
|
2014-07-15 19:36:45 -07:00
|
|
|
/usr/lib /usr/local/lib /opt/local/lib /sw/lib)
|
2014-01-20 07:58:58 -08:00
|
|
|
|
2014-05-21 22:50:56 -07:00
|
|
|
set(LIBX264_INCLUDE_DIRS ${X264_INCLUDE_DIR} CACHE PATH "x264 include dir")
|
|
|
|
set(LIBX264_LIBRARIES ${X264_LIB} CACHE STRING "x264 libraries")
|
2014-01-20 07:58:58 -08:00
|
|
|
|
2014-08-21 07:38:49 -07:00
|
|
|
include(FindPackageHandleStandardArgs)
|
2014-01-20 07:58:58 -08:00
|
|
|
find_package_handle_standard_args(Libx264 DEFAULT_MSG X264_LIB X264_INCLUDE_DIR)
|
|
|
|
mark_as_advanced(X264_INCLUDE_DIR X264_LIB)
|
|
|
|
endif()
|