2014-05-21 22:52:15 -07:00
|
|
|
# Once done these will be defined:
|
|
|
|
#
|
|
|
|
# LIBFDK_FOUND
|
|
|
|
# LIBFDK_INCLUDE_DIRS
|
|
|
|
# LIBFDK_LIBRARIES
|
|
|
|
#
|
2014-07-18 22:23:44 -07:00
|
|
|
# For use in OBS:
|
|
|
|
#
|
|
|
|
# Libfdk_INCLUDE_DIR
|
2014-07-18 20:05:42 -07:00
|
|
|
|
2014-09-15 10:58:31 -07:00
|
|
|
find_package(PkgConfig QUIET)
|
|
|
|
if (PKG_CONFIG_FOUND)
|
|
|
|
pkg_check_modules(_LIBFDK QUIET fdk-aac)
|
|
|
|
endif()
|
2014-05-21 22:52:15 -07: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)
|
2014-05-21 22:52:15 -07:00
|
|
|
endif()
|
|
|
|
|
2014-09-15 10:58:31 -07:00
|
|
|
find_path(Libfdk_INCLUDE_DIR
|
|
|
|
NAMES fdk-aac/aacenc_lib.h
|
|
|
|
HINTS
|
2014-09-23 06:21:27 -07:00
|
|
|
ENV LibfdkPath${_lib_suffix}
|
2014-09-15 10:58:31 -07:00
|
|
|
ENV LibfdkPath
|
2014-09-23 06:21:27 -07:00
|
|
|
${_LIBFDK_INCLUDE_DIRS}
|
2014-09-15 10:58:31 -07:00
|
|
|
PATHS
|
|
|
|
/usr/include /usr/local/include /opt/local/include /sw/include)
|
|
|
|
|
|
|
|
find_library(Libfdk_LIB
|
|
|
|
NAMES ${_LIBFDK_LIBRARIES} fdk-aac libfdk-aac
|
|
|
|
HINTS
|
2014-09-23 06:21:27 -07:00
|
|
|
ENV LibfdkPath${_lib_suffix}
|
|
|
|
ENV LibfdkPath
|
2014-09-15 10:58:31 -07:00
|
|
|
${_LIBFDK_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-09-15 10:58:31 -07:00
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package_handle_standard_args(Libfdk DEFAULT_MSG Libfdk_LIB Libfdk_INCLUDE_DIR)
|
|
|
|
mark_as_advanced(Libfdk_INCLUDE_DIR Libfdk_LIB)
|
|
|
|
|
|
|
|
if(LIBFDK_FOUND)
|
|
|
|
set(LIBFDK_INCLUDE_DIRS ${Libfdk_INCLUDE_DIR})
|
|
|
|
set(LIBFDK_LIBRARIES ${Libfdk_LIB})
|
|
|
|
endif()
|