aboutsummaryrefslogtreecommitdiff
path: root/ports/ffmpeg
diff options
context:
space:
mode:
authorStefano Sinigardi <stesinigardi@hotmail.com>2019-06-21 04:11:54 +0200
committerCurtis J Bezault <curtbezault@gmail.com>2019-06-20 19:11:54 -0700
commit47d206e149e88201333b5ca8fe55c30e2b1a8177 (patch)
treec0620a39116333a6cb6ffc092983ba7114c6daf2 /ports/ffmpeg
parente16efa4d6aa6f36247eb6dfd646fdf81af0c36e0 (diff)
downloadvcpkg-47d206e149e88201333b5ca8fe55c30e2b1a8177.tar.gz
vcpkg-47d206e149e88201333b5ca8fe55c30e2b1a8177.zip
[many ports] improvements for linux/wsl (#6730)
* [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
Diffstat (limited to 'ports/ffmpeg')
-rw-r--r--ports/ffmpeg/CONTROL2
-rw-r--r--ports/ffmpeg/FindFFMPEG.cmake138
-rw-r--r--ports/ffmpeg/portfile.cmake9
-rw-r--r--ports/ffmpeg/vcpkg-cmake-wrapper.cmake8
4 files changed, 141 insertions, 16 deletions
diff --git a/ports/ffmpeg/CONTROL b/ports/ffmpeg/CONTROL
index 209bb2306..4c1565679 100644
--- a/ports/ffmpeg/CONTROL
+++ b/ports/ffmpeg/CONTROL
@@ -1,5 +1,5 @@
Source: ffmpeg
-Version: 4.1-6
+Version: 4.1-8
Homepage: https://ffmpeg.org
Description: a library to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created.
FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. It supports the most obscure ancient formats up to the cutting edge. No matter if they were designed by some standards committee, the community or a corporation. It is also highly portable: FFmpeg compiles, runs, and passes our testing infrastructure FATE across Linux, Mac OS X, Microsoft Windows, the BSDs, Solaris, etc. under a wide variety of build environments, machine architectures, and configurations.
diff --git a/ports/ffmpeg/FindFFMPEG.cmake b/ports/ffmpeg/FindFFMPEG.cmake
index f8e65f53a..65ab59e90 100644
--- a/ports/ffmpeg/FindFFMPEG.cmake
+++ b/ports/ffmpeg/FindFFMPEG.cmake
@@ -1,13 +1,131 @@
-include(FindPackageHandleStandardArgs)
-
-find_path(FFMPEG_INCLUDE_DIRS NAMES libavcodec/avcodec.h)
-unset(FFMPEG_LIBRARIES)
-foreach(FFMPEG_SUBLIBRARY avformat avdevice avcodec avutil swscale)
- find_library(FFMPEG_lib${FFMPEG_SUBLIBRARY}_LIBRARY NAMES ${FFMPEG_SUBLIBRARY})
- list(APPEND FFMPEG_LIBRARIES ${FFMPEG_lib${FFMPEG_SUBLIBRARY}_LIBRARY})
-endforeach()
+# 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)
- list(APPEND FFMPEG_LIBRARIES wsock32 ws2_32 Secur32)
+ 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_INCLUDE_DIRS)
+find_package_handle_standard_args(FFMPEG REQUIRED_VARS FFMPEG_LIBRARIES FFMPEG_LIBRARY_DIRS FFMPEG_INCLUDE_DIRS)
diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake
index 1ce53a996..15be7468b 100644
--- a/ports/ffmpeg/portfile.cmake
+++ b/ports/ffmpeg/portfile.cmake
@@ -36,7 +36,7 @@ else()
set(LIB_PATH_VAR "LIBRARY_PATH")
endif()
-if (WIN32)
+if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
set(ENV{PATH} "$ENV{PATH};${YASM_EXE_PATH}")
set(BUILD_SCRIPT ${CMAKE_CURRENT_LIST_DIR}\\build.sh)
@@ -243,8 +243,7 @@ vcpkg_copy_pdbs()
# Handle copyright
# TODO: Examine build log and confirm that this license matches the build output
-file(COPY ${SOURCE_PATH}/COPYING.LGPLv2.1 DESTINATION ${CURRENT_PACKAGES_DIR}/share/ffmpeg)
-file(RENAME ${CURRENT_PACKAGES_DIR}/share/ffmpeg/COPYING.LGPLv2.1 ${CURRENT_PACKAGES_DIR}/share/ffmpeg/copyright)
+file(INSTALL ${SOURCE_PATH}/COPYING.LGPLv2.1 DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
-# Used by OpenCV
-file(COPY ${CMAKE_CURRENT_LIST_DIR}/FindFFMPEG.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/ffmpeg)
+file(COPY ${CMAKE_CURRENT_LIST_DIR}/FindFFMPEG.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
+file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
diff --git a/ports/ffmpeg/vcpkg-cmake-wrapper.cmake b/ports/ffmpeg/vcpkg-cmake-wrapper.cmake
new file mode 100644
index 000000000..322387565
--- /dev/null
+++ b/ports/ffmpeg/vcpkg-cmake-wrapper.cmake
@@ -0,0 +1,8 @@
+set(FFMPEG_PREV_MODULE_PATH ${CMAKE_MODULE_PATH})
+list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
+
+if(NOT FFMPEG_LIBRARIES)
+ _find_package(${ARGS})
+endif()
+
+set(CMAKE_MODULE_PATH ${FFMPEG_PREV_MODULE_PATH})