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-09-15 10:58:31 -07:00
|
|
|
find_package(PkgConfig QUIET)
|
|
|
|
if (PKG_CONFIG_FOUND)
|
|
|
|
pkg_check_modules(_X264 QUIET x264)
|
|
|
|
endif()
|
2014-01-20 07:58:58 -08:00
|
|
|
|
2014-09-15 10:58:31 -07:00
|
|
|
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
|
|
set(_lib_suffix 64)
|
|
|
|
else()
|
|
|
|
set(_lib_suffix 32)
|
|
|
|
endif()
|
2014-01-20 07:58:58 -08:00
|
|
|
|
2014-09-15 10:58:31 -07:00
|
|
|
find_path(X264_INCLUDE_DIR
|
|
|
|
NAMES x264.h
|
|
|
|
HINTS
|
2014-09-23 06:21:27 -07:00
|
|
|
ENV x264Path${_lib_suffix}
|
2014-09-15 10:58:31 -07:00
|
|
|
ENV x264Path
|
2015-06-30 10:05:20 -07:00
|
|
|
ENV DepsPath${_lib_suffix}
|
|
|
|
ENV DepsPath
|
2015-07-13 14:36:20 -07:00
|
|
|
${x264Path${_lib_suffix}}
|
2015-06-30 10:05:20 -07:00
|
|
|
${x264Path}
|
2015-07-13 14:36:20 -07:00
|
|
|
${DepsPath${_lib_suffix}}
|
2015-06-30 10:05:20 -07:00
|
|
|
${DepsPath}
|
2014-09-23 06:21:27 -07:00
|
|
|
${_X264_INCLUDE_DIRS}
|
2014-09-15 10:58:31 -07:00
|
|
|
PATHS
|
2015-08-12 04:21:26 -07:00
|
|
|
/usr/include /usr/local/include /opt/local/include /sw/include
|
|
|
|
PATH_SUFFIXES
|
|
|
|
include)
|
2014-01-20 07:58:58 -08:00
|
|
|
|
2014-09-15 10:58:31 -07:00
|
|
|
find_library(X264_LIB
|
|
|
|
NAMES ${_X264_LIBRARIES} x264 libx264
|
|
|
|
HINTS
|
2014-09-23 06:21:27 -07:00
|
|
|
ENV x264Path${_lib_suffix}
|
|
|
|
ENV x264Path
|
2015-07-13 14:36:20 -07:00
|
|
|
ENV DepsPath${_lib_suffix}
|
|
|
|
ENV DepsPath
|
|
|
|
${x264Path${_lib_suffix}}
|
|
|
|
${x264Path}
|
|
|
|
${DepsPath${_lib_suffix}}
|
|
|
|
${DepsPath}
|
2014-09-15 10:58:31 -07:00
|
|
|
${_X264_LIBRARY_DIRS}
|
|
|
|
PATHS
|
2014-09-23 06:21:27 -07:00
|
|
|
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
|
|
|
PATH_SUFFIXES
|
|
|
|
lib${_lib_suffix} lib
|
|
|
|
libs${_lib_suffix} libs
|
|
|
|
bin${_lib_suffix} bin
|
|
|
|
../lib${_lib_suffix} ../lib
|
|
|
|
../libs${_lib_suffix} ../libs
|
|
|
|
../bin${_lib_suffix} ../bin)
|
2014-01-20 07:58:58 -08:00
|
|
|
|
2014-09-15 10:58:31 -07:00
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package_handle_standard_args(Libx264 DEFAULT_MSG X264_LIB X264_INCLUDE_DIR)
|
|
|
|
mark_as_advanced(X264_INCLUDE_DIR X264_LIB)
|
2014-01-20 07:58:58 -08:00
|
|
|
|
2014-09-15 10:58:31 -07:00
|
|
|
if(LIBX264_FOUND)
|
|
|
|
set(LIBX264_INCLUDE_DIRS ${X264_INCLUDE_DIR})
|
|
|
|
set(LIBX264_LIBRARIES ${X264_LIB})
|
2014-01-20 07:58:58 -08:00
|
|
|
endif()
|