mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-12 03:49:27 +08:00
47d206e149
* [many ports] improve compatibility with WSL and mixed case filesystems * [treehopper] express dependency on libusb, which was not working on non-win32 platforms and is still broken there * [libharu] add compatibility with non-win32 platforms * [geogram] fix openblas on linux [clapack] better integration with linux environment [visit-struct] put cmake config file in the expected folder [geogram] remove trailing underscore to enable compatibility with OpenBLAS * [openblas] playing with underscore, without success * [openblas/lapack] fix library integration * [clapack] improve target handling in cmake module * [openblas] promote self-generated config to default cmake module, otherwise internal ones thinks wrongly that openblas can also solve lapack libs * [clapack,openblas] improve libraries integration * [many ports] fix cmake unnecessary target paths, wrong config paths, empty default dependencies, unnecessary [core] tags * [suitesparse] improve integration with new lapack/openblas mechanism * [suitesparse] add no underscore postfix also for linux * [ceres] fix integration with newer openblas/lapack configs * [aws-c-event-stream] fix regression * [systemc] fix regression * [libwebp,geogram] trigger rebuild * [libwebp,pthread4w] fix regressions * [glbinding] fix cmake module installation * [globjects] disentangle unnecessary dependency from qt5 * [jasper] remove broken and unnecessary patches * [libwebp] fix regression * [many ports] avoid using BUILD_SHARED_LIBS which is uninitialized in port files * [clapack] correctly find dlls * [clapack] use a generic blas as dependency * [fizz,g2o] restore expected version * fix mistake * [many ports] remove WIN32, APPLE and UNIX (again, they keep creeping in) from ports since they are broken and usually break non-win32 ports * [libressl,openssl] do not try to build one if the other is already installed * [itk] update ref and patch to avoid regression * [libressl,openssl] implement full strategy to fix CI * [libwebp] disable components that are broken on macOS * [ogre] enable macOS build * [freeimage,jxrlib,ogre,openexr,protobuf] port patches from #5169 * [ogre] add missing install command * [ffmpeg] enable wrapper for cmake module * [ffmpeg] add avresample module finder * [ffmpeg] improve module detection and exported symbols * [ffmpeg] add variables to cache * [thrift] remove unnecessary build option * [allegro5] fix shared/static inversion * [protobuf] cleanup * [libressl] cleanup * [moos-core] cleanup * commented features must not be separated from other features, otherwise vcpkg complains * [itk] fix regression * [shogun,itk] fix regressions * [ogre] fix regression * [opusfile] add compatibility with non-win32 * [itk] fix regression * [sndfile,libsndfile] remove duplicate, redirect sndfile to libsndfile * add missing dependencies * [ismrmrd] fix regression * [ffmpeg] trigger rebuild * [clapack,openblas,libogg] fix regressions on macOS * [libtins] fix regression * force rebuild windows regressions, unable to reproduce locally * [mosquitto] enable non-win32 builds * [json-dto] force rebuild, unable to reproduce regression locally * [many ports] uniform naming and path length requests * fix regression * fix regression * [ffmpeg] fixes for downstream projects * clean up - thanks to reviewers * trigger rebuild of regressions on macOS * trigger rebuild of regressions on macOS - part2 * Add core back * Use VCPKG_CONCURRENCY * Add core back to suitesparse * Add core back to curl * Add core back to magnum * Add core back to magnum * Add core back to magnum * Add core back to cgal
132 lines
5.2 KiB
CMake
132 lines
5.2 KiB
CMake
# Distributed under the OSI-approved BSD 3-Clause License.
|
|
#
|
|
#.rst:
|
|
# FindFFMPEG
|
|
# --------
|
|
#
|
|
# Find the FFPMEG libraries
|
|
#
|
|
# Result Variables
|
|
# ^^^^^^^^^^^^^^^^
|
|
#
|
|
# The following variables will be defined:
|
|
#
|
|
# ``FFMPEG_FOUND``
|
|
# True if FFMPEG found on the local system
|
|
#
|
|
# ``FFMPEG_INCLUDE_DIRS``
|
|
# Location of FFMPEG header files
|
|
#
|
|
# ``FFMPEG_LIBRARY_DIRS``
|
|
# Location of FFMPEG libraries
|
|
#
|
|
# ``FFMPEG_LIBRARIES``
|
|
# List of the FFMPEG libraries found
|
|
#
|
|
# Hints
|
|
# ^^^^^
|
|
#
|
|
# ``FFMPEG_ROOT``
|
|
# Set this variable to a directory that contains a FFMPEG installation
|
|
#
|
|
#
|
|
|
|
include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
|
|
include(${CMAKE_ROOT}/Modules/SelectLibraryConfigurations.cmake)
|
|
include(${CMAKE_ROOT}/Modules/CMakeFindDependencyMacro.cmake)
|
|
|
|
find_dependency(Threads)
|
|
#list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS Threads::Threads)
|
|
if(UNIX)
|
|
list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS -pthread)
|
|
endif()
|
|
|
|
# Platform dependent libraries required by FFMPEG
|
|
if(WIN32)
|
|
if(NOT CYGWIN)
|
|
list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS wsock32 ws2_32 Secur32)
|
|
endif()
|
|
else()
|
|
list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS m)
|
|
endif()
|
|
|
|
macro(FFMPEG_FIND varname shortname headername)
|
|
if(NOT FFMPEG_${varname}_INCLUDE_DIRS)
|
|
find_path(FFMPEG_${varname}_INCLUDE_DIRS NAMES lib${shortname}/${headername} ${headername} PATH_SUFFIXES ffmpeg)
|
|
endif()
|
|
if(NOT FFMPEG_${varname}_LIBRARY)
|
|
find_library(FFMPEG_${varname}_LIBRARY_RELEASE NAMES ${shortname} PATH_SUFFIXES ffmpeg ffmpeg/lib)
|
|
get_filename_component(FFMPEG_${varname}_LIBRARY_RELEASE_DIR ${FFMPEG_${varname}_LIBRARY_RELEASE} DIRECTORY)
|
|
find_library(FFMPEG_${varname}_LIBRARY_DEBUG NAMES ${shortname}d ${shortname} PATHS debug PATH_SUFFIXES ffmpeg ffmpeg/lib ffmpeg/debug/lib debug/ffmpeg/lib)
|
|
get_filename_component(FFMPEG_${varname}_LIBRARY_DEBUG_DIR ${FFMPEG_${varname}_LIBRARY_DEBUG} DIRECTORY)
|
|
select_library_configurations(FFMPEG_${varname})
|
|
endif()
|
|
if (FFMPEG_${varname}_LIBRARY AND FFMPEG_${varname}_INCLUDE_DIRS)
|
|
set(FFMPEG_${varname}_FOUND 1)
|
|
list(APPEND FFMPEG_LIBRARY_DIRS ${FFMPEG_${varname}_LIBRARY_RELEASE_DIR} ${FFMPEG_${varname}_LIBRARY_DEBUG_DIR})
|
|
endif()
|
|
endmacro(FFMPEG_FIND)
|
|
|
|
macro(FFMPEG_FIND_GENEX varname shortname headername)
|
|
if(NOT FFMPEG_${varname}_INCLUDE_DIRS)
|
|
find_path(FFMPEG_${varname}_INCLUDE_DIRS NAMES lib${shortname}/${headername} ${headername} PATH_SUFFIXES ffmpeg)
|
|
endif()
|
|
if(NOT FFMPEG_${varname}_LIBRARY)
|
|
find_library(FFMPEG_${varname}_LIBRARY_RELEASE NAMES ${shortname} PATH_SUFFIXES ffmpeg ffmpeg/lib)
|
|
get_filename_component(FFMPEG_${varname}_LIBRARY_RELEASE_DIR ${FFMPEG_${varname}_LIBRARY_RELEASE} DIRECTORY)
|
|
find_library(FFMPEG_${varname}_LIBRARY_DEBUG NAMES ${shortname}d ${shortname} PATHS debug PATH_SUFFIXES ffmpeg ffmpeg/lib ffmpeg/debug/lib debug/ffmpeg/lib)
|
|
get_filename_component(FFMPEG_${varname}_LIBRARY_DEBUG_DIR ${FFMPEG_${varname}_LIBRARY_DEBUG} DIRECTORY)
|
|
set(FFMPEG_${varname}_LIBRARY "$<$<CONFIG:Debug>:${FFMPEG_${varname}_LIBRARY_DEBUG}>$<$<CONFIG:Release>:${FFMPEG_${varname}_LIBRARY_RELEASE}>" CACHE STRING "")
|
|
set(FFMPEG_${varname}_LIBRARIES ${FFMPEG_${varname}_LIBRARY} CACHE STRING "")
|
|
endif()
|
|
if (FFMPEG_${varname}_LIBRARY AND FFMPEG_${varname}_INCLUDE_DIRS)
|
|
set(FFMPEG_${varname}_FOUND 1)
|
|
list(APPEND FFMPEG_LIBRARY_DIRS ${FFMPEG_${varname}_LIBRARY_RELEASE_DIR} ${FFMPEG_${varname}_LIBRARY_DEBUG_DIR})
|
|
endif()
|
|
endmacro(FFMPEG_FIND)
|
|
|
|
if(WIN32)
|
|
if(NOT FFMPEG_${varname}_INCLUDE_DIRS)
|
|
find_path(FFMPEG_stdint_INCLUDE_DIRS NAMES stdint.h PATH_SUFFIXES ffmpeg)
|
|
endif()
|
|
if (FFMPEG_stdint_INCLUDE_DIRS)
|
|
set(STDINT_OK TRUE)
|
|
endif()
|
|
else()
|
|
set(STDINT_OK TRUE)
|
|
endif()
|
|
|
|
FFMPEG_FIND(libavcodec avcodec avcodec.h)
|
|
FFMPEG_FIND(libavdevice avdevice avdevice.h)
|
|
FFMPEG_FIND(libavfilter avfilter avfilter.h)
|
|
FFMPEG_FIND(libavformat avformat avformat.h)
|
|
FFMPEG_FIND(libavutil avutil avutil.h)
|
|
FFMPEG_FIND(libswresample swresample swresample.h)
|
|
FFMPEG_FIND(libswscale swscale swscale.h)
|
|
FFMPEG_FIND_GENEX(libzlib zlib zlib.h)
|
|
|
|
if (FFMPEG_libavcodec_FOUND AND FFMPEG_libavdevice_FOUND AND FFMPEG_libavfilter_FOUND AND FFMPEG_libavformat_FOUND AND FFMPEG_libavutil_FOUND AND FFMPEG_libswresample_FOUND AND FFMPEG_libswscale_FOUND AND FFMPEG_libzlib_FOUND AND STDINT_OK)
|
|
list(APPEND FFMPEG_INCLUDE_DIRS ${FFMPEG_libavformat_INCLUDE_DIRS} ${FFMPEG_libavdevice_INCLUDE_DIRS} ${FFMPEG_libavcodec_INCLUDE_DIRS} ${FFMPEG_libavutil_INCLUDE_DIRS} ${FFMPEG_libswscale_INCLUDE_DIRS} ${FFMPEG_stdint_INCLUDE_DIRS})
|
|
list(REMOVE_DUPLICATES FFMPEG_INCLUDE_DIRS)
|
|
list(REMOVE_DUPLICATES FFMPEG_LIBRARY_DIRS)
|
|
|
|
list(APPEND FFMPEG_LIBRARIES
|
|
${FFMPEG_libavformat_LIBRARY}
|
|
${FFMPEG_libavdevice_LIBRARY}
|
|
${FFMPEG_libavcodec_LIBRARY}
|
|
${FFMPEG_libavutil_LIBRARY}
|
|
${FFMPEG_libswscale_LIBRARY}
|
|
${FFMPEG_libavfilter_LIBRARY}
|
|
${FFMPEG_libswresample_LIBRARY}
|
|
${FFMPEG_libzlib_LIBRARY}
|
|
${FFMPEG_PLATFORM_DEPENDENT_LIBS}
|
|
)
|
|
set(FFMPEG_LIBRARY ${FFMPEG_LIBRARIES})
|
|
|
|
set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} CACHE STRING "")
|
|
set(FFMPEG_INCLUDE_DIRS ${FFMPEG_INCLUDE_DIRS} CACHE STRING "")
|
|
set(FFMPEG_LIBRARY_DIRS ${FFMPEG_LIBRARY_DIRS} CACHE STRING "")
|
|
endif()
|
|
|
|
find_package_handle_standard_args(FFMPEG REQUIRED_VARS FFMPEG_LIBRARIES FFMPEG_LIBRARY_DIRS FFMPEG_INCLUDE_DIRS)
|