From 839cdff896114d423bfdb0abc8ffa6bb6d839337 Mon Sep 17 00:00:00 2001 From: Stefano Sinigardi Date: Mon, 23 Sep 2019 22:46:16 +0200 Subject: [ffmpeg] update to 4.2 (#8021) * [ffmpeg] update to 4.2 * [ffmpeg] add missing dependencies under linux --- ports/ffmpeg/0001-create-lib-libraries.patch | 25 +++ ports/ffmpeg/0002-detect-openssl.patch | 14 ++ ports/ffmpeg/0003-fix-windowsinclude.patch | 28 ++++ ports/ffmpeg/0004-fix-debug-build.patch | 30 ++++ ports/ffmpeg/0005-fix-libvpx-linking.patch | 53 +++++++ ports/ffmpeg/CONTROL | 5 +- ports/ffmpeg/FindFFMPEG.cmake | 164 ------------------- ports/ffmpeg/FindFFMPEG.cmake.in | 174 +++++++++++++++++++++ ports/ffmpeg/create-lib-libraries.patch | 38 ----- ports/ffmpeg/detect-openssl.patch | 22 --- ports/ffmpeg/fix-debug-build.patch | 30 ---- ports/ffmpeg/fix_libvpx_windows_linking.patch | 55 ------- .../ffmpeg/fix_windowsinclude-in-ffmpegexe-1.patch | 11 -- .../ffmpeg/fix_windowsinclude-in-ffmpegexe-2.patch | 14 -- ports/ffmpeg/portfile.cmake | 42 ++--- 15 files changed, 348 insertions(+), 357 deletions(-) create mode 100644 ports/ffmpeg/0001-create-lib-libraries.patch create mode 100644 ports/ffmpeg/0002-detect-openssl.patch create mode 100644 ports/ffmpeg/0003-fix-windowsinclude.patch create mode 100644 ports/ffmpeg/0004-fix-debug-build.patch create mode 100644 ports/ffmpeg/0005-fix-libvpx-linking.patch delete mode 100644 ports/ffmpeg/FindFFMPEG.cmake create mode 100644 ports/ffmpeg/FindFFMPEG.cmake.in delete mode 100644 ports/ffmpeg/create-lib-libraries.patch delete mode 100644 ports/ffmpeg/detect-openssl.patch delete mode 100644 ports/ffmpeg/fix-debug-build.patch delete mode 100644 ports/ffmpeg/fix_libvpx_windows_linking.patch delete mode 100644 ports/ffmpeg/fix_windowsinclude-in-ffmpegexe-1.patch delete mode 100644 ports/ffmpeg/fix_windowsinclude-in-ffmpegexe-2.patch diff --git a/ports/ffmpeg/0001-create-lib-libraries.patch b/ports/ffmpeg/0001-create-lib-libraries.patch new file mode 100644 index 000000000..493e24c1b --- /dev/null +++ b/ports/ffmpeg/0001-create-lib-libraries.patch @@ -0,0 +1,25 @@ +diff --git a/configure b/configure +index 34c2adb..1c8008a 100755 +--- a/configure ++++ b/configure +@@ -5352,15 +5352,17 @@ case $target_os in + ;; + win32|win64) + disable symver +- if enabled shared; then ++# if enabled shared; then + # Link to the import library instead of the normal static library + # for shared libs. + LD_LIB='%.lib' + # Cannot build both shared and static libs with MSVC or icl. +- disable static +- fi ++# disable static ++# fi + enabled x86_32 && check_ldflags -LARGEADDRESSAWARE + shlibdir_default="$bindir_default" ++ LIBPREF="" ++ LIBSUF=".lib" + SLIBPREF="" + SLIBSUF=".dll" + SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)' diff --git a/ports/ffmpeg/0002-detect-openssl.patch b/ports/ffmpeg/0002-detect-openssl.patch new file mode 100644 index 000000000..87a7656c8 --- /dev/null +++ b/ports/ffmpeg/0002-detect-openssl.patch @@ -0,0 +1,14 @@ +diff --git a/configure b/configure +index 1c8008a..bd2de34 100755 +--- a/configure ++++ b/configure +@@ -6360,7 +6360,8 @@ enabled openssl && { check_pkg_config openssl openssl openssl/ssl.h OP + check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto || + check_lib openssl openssl/ssl.h SSL_library_init -lssl32 -leay32 || + check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 || +- die "ERROR: openssl not found"; } ++ check_lib openssl openssl/ssl.h SSL_library_init -llibeay32 -lssleay32 || ++ die "ERROR: openssl not found"; } + enabled pocketsphinx && require_pkg_config pocketsphinx pocketsphinx pocketsphinx/pocketsphinx.h ps_init + enabled rkmpp && { require_pkg_config rkmpp rockchip_mpp rockchip/rk_mpi.h mpp_create && + require_pkg_config rockchip_mpp "rockchip_mpp >= 1.3.7" rockchip/rk_mpi.h mpp_create && diff --git a/ports/ffmpeg/0003-fix-windowsinclude.patch b/ports/ffmpeg/0003-fix-windowsinclude.patch new file mode 100644 index 000000000..8fe6a5474 --- /dev/null +++ b/ports/ffmpeg/0003-fix-windowsinclude.patch @@ -0,0 +1,28 @@ +diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c +index 9cfbc45..e3447e6 100644 +--- a/fftools/cmdutils.c ++++ b/fftools/cmdutils.c +@@ -63,6 +63,8 @@ + #include + #endif + #ifdef _WIN32 ++#define _WIN32_WINNT 0x0502 ++#define WIN32_LEAN_AND_MEAN + #include + #endif + +diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c +index 01f0410..dbb0736 100644 +--- a/fftools/ffmpeg.c ++++ b/fftools/ffmpeg.c +@@ -23,6 +23,10 @@ + * multimedia converter based on the FFmpeg libraries + */ + ++#define _WIN32_WINNT 0x0502 // Must be less than 0x0600, because otherwise WinSock2.h defines "pollfd" which then gets redefined in "os_support.h". ++#define WIN32_LEAN_AND_MEAN ++ ++ + #include "config.h" + #include + #include diff --git a/ports/ffmpeg/0004-fix-debug-build.patch b/ports/ffmpeg/0004-fix-debug-build.patch new file mode 100644 index 000000000..6fe0780db --- /dev/null +++ b/ports/ffmpeg/0004-fix-debug-build.patch @@ -0,0 +1,30 @@ +diff --git a/configure b/configure +index bd2de34..fba948a 100755 +--- a/configure ++++ b/configure +@@ -3993,6 +3993,9 @@ for opt do + --libfuzzer=*) + libfuzzer_path="$optval" + ;; ++ --debug) ++ enable debug_configure ++ ;; + *) + optname="${opt%%=*}" + optname="${optname#--}" +@@ -6152,8 +6155,13 @@ fi + + enabled zlib && { check_pkg_config zlib zlib "zlib.h" zlibVersion || + check_lib zlib zlib.h zlibVersion -lz; } +-enabled bzlib && check_lib bzlib bzlib.h BZ2_bzlibVersion -lbz2 +-enabled lzma && check_lib lzma lzma.h lzma_version_number -llzma ++if enabled debug_configure; then ++ enabled bzlib && check_lib bzlib bzlib.h BZ2_bzlibVersion -lbz2d ++ enabled lzma && check_lib lzma lzma.h lzma_version_number -llzmad ++else ++ enabled bzlib && check_lib bzlib bzlib.h BZ2_bzlibVersion -lbz2 ++ enabled lzma && check_lib lzma lzma.h lzma_version_number -llzma ++fi + + # On some systems dynamic loading requires no extra linker flags + check_lib libdl dlfcn.h "dlopen dlsym" || check_lib libdl dlfcn.h "dlopen dlsym" -ldl diff --git a/ports/ffmpeg/0005-fix-libvpx-linking.patch b/ports/ffmpeg/0005-fix-libvpx-linking.patch new file mode 100644 index 000000000..dac5e5928 --- /dev/null +++ b/ports/ffmpeg/0005-fix-libvpx-linking.patch @@ -0,0 +1,53 @@ +diff --git a/configure b/configure +index fba948a..50eea9b 100755 +--- a/configure ++++ b/configure +@@ -5207,6 +5207,8 @@ case "$arch" in + ;; + esac + ++libvpx_name=vpx ++ + # OS specific + case $target_os in + aix) +@@ -5379,6 +5381,15 @@ case $target_os in + enabled x86_64 && objformat="win64" || objformat="win32" + ranlib=: + enable dos_paths ++ if [ -z "${extra_cflags##*-MDd*}" ]; then ++ libvpx_name=vpxmdd ++ elif [ -z "${extra_cflags##*-MD*}" ]; then ++ libvpx_name=vpxmd ++ elif [ -z "${extra_cflags##*-MTd*}" ]; then ++ libvpx_name=vpxmtd ++ elif [ -z "${extra_cflags##*-MT*}" ]; then ++ libvpx_name=vpxmt ++ fi + ;; + cygwin*) + target_os=cygwin +@@ -6290,19 +6301,19 @@ enabled libvorbis && require_pkg_config libvorbis vorbis vorbis/codec.h + enabled libvpx && { + enabled libvpx_vp8_decoder && { + check_pkg_config libvpx_vp8_decoder "vpx >= 1.4.0" "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp8_dx || +- check_lib libvpx_vp8_decoder "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp8_dx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs $pthreads_extralibs" ++ check_lib libvpx_vp8_decoder "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp8_dx VPX_IMG_FMT_HIGHBITDEPTH" "-l$libvpx_name $libm_extralibs $pthreads_extralibs" + } + enabled libvpx_vp8_encoder && { + check_pkg_config libvpx_vp8_encoder "vpx >= 1.4.0" "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp8_cx || +- check_lib libvpx_vp8_encoder "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp8_cx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs $pthreads_extralibs" ++ check_lib libvpx_vp8_encoder "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp8_cx VPX_IMG_FMT_HIGHBITDEPTH" "-l$libvpx_name $libm_extralibs $pthreads_extralibs" + } + enabled libvpx_vp9_decoder && { + check_pkg_config libvpx_vp9_decoder "vpx >= 1.4.0" "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp9_dx || +- check_lib libvpx_vp9_decoder "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp9_dx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs $pthreads_extralibs" ++ check_lib libvpx_vp9_decoder "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp9_dx VPX_IMG_FMT_HIGHBITDEPTH" "-l$libvpx_name $libm_extralibs $pthreads_extralibs" + } + enabled libvpx_vp9_encoder && { + check_pkg_config libvpx_vp9_encoder "vpx >= 1.4.0" "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp9_cx || +- check_lib libvpx_vp9_encoder "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs $pthreads_extralibs" ++ check_lib libvpx_vp9_encoder "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx VPX_IMG_FMT_HIGHBITDEPTH" "-l$libvpx_name $libm_extralibs $pthreads_extralibs" + } + if disabled_all libvpx_vp8_decoder libvpx_vp9_decoder libvpx_vp8_encoder libvpx_vp9_encoder; then + die "libvpx enabled but no supported decoders found" diff --git a/ports/ffmpeg/CONTROL b/ports/ffmpeg/CONTROL index 724a849c2..578a8a91a 100644 --- a/ports/ffmpeg/CONTROL +++ b/ports/ffmpeg/CONTROL @@ -1,13 +1,14 @@ Source: ffmpeg -Version: 4.1-11 +Version: 4.2 Build-Depends: zlib 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. +Default-Features: avresample Feature: ffmpeg Description: build the ffmpeg.exe application - + Feature: ffserver Description: ffserver appplication support in ffmpeg diff --git a/ports/ffmpeg/FindFFMPEG.cmake b/ports/ffmpeg/FindFFMPEG.cmake deleted file mode 100644 index 4ed03f457..000000000 --- a/ports/ffmpeg/FindFFMPEG.cmake +++ /dev/null @@ -1,164 +0,0 @@ -# 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) - -set(FFMPEG_VERSION "4.1") - -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 bcrypt) - 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 "$<$:${FFMPEG_${varname}_LIBRARY_DEBUG}>$<$:${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_GENEX) - -if(WIN32) - FFMPEG_FIND_GENEX(libzlib zlib zlib.h) -else() - FFMPEG_FIND_GENEX(libzlib z zlib.h) -endif() - -if(APPLE) - find_library(VT_UNIT VideoToolbox) - if (NOT VT_UNIT) - message(FATAL_ERROR "VideoToolbox not found") - endif() - find_library(AT_UNIT AudioToolbox) - if (NOT AT_UNIT) - message(FATAL_ERROR "AudioToolbox not found") - endif() - find_library(SEC_UNIT Security) - if (NOT SEC_UNIT) - message(FATAL_ERROR "Security not found") - endif() - find_library(CF_UNIT CoreFoundation) - if (NOT CF_UNIT) - message(FATAL_ERROR "CoreFoundation not found") - endif() - find_library(CM_UNIT CoreMedia) - if (NOT CM_UNIT) - message(FATAL_ERROR "CoreMedia not found") - endif() - find_library(CV_UNIT CoreVideo) - if (NOT CV_UNIT) - message(FATAL_ERROR "CoreVideo not found") - endif() - find_package(Iconv QUIET) - list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS ${VT_UNIT} ${AT_UNIT} ${SEC_UNIT} ${CF_UNIT} ${CM_UNIT} ${CV_UNIT} ${Iconv_LIBRARIES}) -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) - -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) - 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}) - list(REMOVE_DUPLICATES FFMPEG_INCLUDE_DIRS) - list(REMOVE_DUPLICATES FFMPEG_LIBRARY_DIRS) - - set(FFMPEG_libavformat_VERSION "${FFMPEG_VERSION}" CACHE STRING "") - set(FFMPEG_libavdevice_VERSION "${FFMPEG_VERSION}" CACHE STRING "") - set(FFMPEG_libavcodec_VERSION "${FFMPEG_VERSION}" CACHE STRING "") - set(FFMPEG_libavutil_VERSION "${FFMPEG_VERSION}" CACHE STRING "") - set(FFMPEG_libswscale_VERSION "${FFMPEG_VERSION}" CACHE STRING "") - set(FFMPEG_libavfilter_VERSION "${FFMPEG_VERSION}" CACHE STRING "") - set(FFMPEG_libswresample_VERSION "${FFMPEG_VERSION}" CACHE STRING "") - - 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) diff --git a/ports/ffmpeg/FindFFMPEG.cmake.in b/ports/ffmpeg/FindFFMPEG.cmake.in new file mode 100644 index 000000000..d5139220b --- /dev/null +++ b/ports/ffmpeg/FindFFMPEG.cmake.in @@ -0,0 +1,174 @@ +# 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 +# +# + +include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake) +include(${CMAKE_ROOT}/Modules/SelectLibraryConfigurations.cmake) +include(${CMAKE_ROOT}/Modules/CMakeFindDependencyMacro.cmake) + +set(FFMPEG_VERSION "4.2") + +find_dependency(Threads) +if(UNIX) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS -pthread -lvdpau -lX11) +endif() + +if(@ENABLE_BZIP2@) + find_dependency(BZip2) + get_target_property(BZip2_LIBRARY_RELEASE BZip2::BZip2 IMPORTED_LOCATION_RELEASE) + get_target_property(BZip2_LIBRARY_DEBUG BZip2::BZip2 IMPORTED_LOCATION_DEBUG) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${BZip2_LIBRARY_DEBUG}>$<$:${BZip2_LIBRARY_RELEASE}>") +endif() + +if(@ENABLE_LZMA@) + find_dependency(LibLZMA) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${LibLZMA_LIBRARY_DEBUG}>$<$:${LibLZMA_LIBRARY_RELEASE}>") +endif() + +# Platform dependent libraries required by FFMPEG +if(WIN32) + if(NOT CYGWIN) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS wsock32 ws2_32 Secur32 bcrypt) + 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 "$<$:${FFMPEG_${varname}_LIBRARY_DEBUG}>$<$:${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_GENEX) + +if(WIN32) + FFMPEG_FIND_GENEX(libzlib zlib zlib.h) +else() + FFMPEG_FIND_GENEX(libzlib z zlib.h) +endif() + +if(APPLE) + find_library(VT_UNIT VideoToolbox) + if (NOT VT_UNIT) + message(FATAL_ERROR "VideoToolbox not found") + endif() + find_library(AT_UNIT AudioToolbox) + if (NOT AT_UNIT) + message(FATAL_ERROR "AudioToolbox not found") + endif() + find_library(SEC_UNIT Security) + if (NOT SEC_UNIT) + message(FATAL_ERROR "Security not found") + endif() + find_library(CF_UNIT CoreFoundation) + if (NOT CF_UNIT) + message(FATAL_ERROR "CoreFoundation not found") + endif() + find_library(CM_UNIT CoreMedia) + if (NOT CM_UNIT) + message(FATAL_ERROR "CoreMedia not found") + endif() + find_library(CV_UNIT CoreVideo) + if (NOT CV_UNIT) + message(FATAL_ERROR "CoreVideo not found") + endif() + find_package(Iconv QUIET) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS ${VT_UNIT} ${AT_UNIT} ${SEC_UNIT} ${CF_UNIT} ${CM_UNIT} ${CV_UNIT} ${Iconv_LIBRARIES}) +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(libavresample avresample avresample.h) +FFMPEG_FIND(libavutil avutil avutil.h) +FFMPEG_FIND(libswresample swresample swresample.h) +FFMPEG_FIND(libswscale swscale swscale.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) + 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}) + list(REMOVE_DUPLICATES FFMPEG_INCLUDE_DIRS) + list(REMOVE_DUPLICATES FFMPEG_LIBRARY_DIRS) + + set(FFMPEG_libavcodec_VERSION "${FFMPEG_VERSION}" CACHE STRING "") + set(FFMPEG_libavdevice_VERSION "${FFMPEG_VERSION}" CACHE STRING "") + set(FFMPEG_libavfilter_VERSION "${FFMPEG_VERSION}" CACHE STRING "") + set(FFMPEG_libavformat_VERSION "${FFMPEG_VERSION}" CACHE STRING "") + if(FFMPEG_libavresample_FOUND) + set(FFMPEG_libavresample_VERSION "${FFMPEG_VERSION}" CACHE STRING "") + endif() + set(FFMPEG_libavutil_VERSION "${FFMPEG_VERSION}" CACHE STRING "") + set(FFMPEG_libswresample_VERSION "${FFMPEG_VERSION}" CACHE STRING "") + set(FFMPEG_libswscale_VERSION "${FFMPEG_VERSION}" CACHE STRING "") + + 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_libavresample_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) diff --git a/ports/ffmpeg/create-lib-libraries.patch b/ports/ffmpeg/create-lib-libraries.patch deleted file mode 100644 index ccad5ff8c..000000000 --- a/ports/ffmpeg/create-lib-libraries.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 5f7c72d6c93fb1f4a730e2315fff6e5eb9bb95c8 Mon Sep 17 00:00:00 2001 -From: Anonymous Maarten -Date: Wed, 27 Sep 2017 15:50:40 +0200 -Subject: [PATCH] configure: create .lib static libraries using MSVC compiler - (instead of .a) - ---- - configure | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/configure b/configure -index ba38a73906..0a3f308323 100755 ---- a/configure -+++ b/configure -@@ -4890,15 +4890,17 @@ - ;; - win32|win64) - disable symver -- if enabled shared; then -+# if enabled shared; then - # Link to the import library instead of the normal static library - # for shared libs. - LD_LIB='%.lib' - # Cannot build both shared and static libs with MSVC or icl. -- disable static -- fi -+# disable static -+# fi - enabled x86_32 && check_ldflags -LARGEADDRESSAWARE - shlibdir_default="$bindir_default" -+ LIBPREF="" -+ LIBSUF=".lib" - SLIBPREF="" - SLIBSUF=".dll" - SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)' --- -2.14.1.windows.1 - diff --git a/ports/ffmpeg/detect-openssl.patch b/ports/ffmpeg/detect-openssl.patch deleted file mode 100644 index affd37d15..000000000 --- a/ports/ffmpeg/detect-openssl.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 18de5c60ae0a987680681d5a0602009b428504fa Mon Sep 17 00:00:00 2001 -From: Gilles Khouzam -Date: Mon, 19 Jun 2017 16:33:38 -0700 -Subject: [PATCH] Add better detection for Openssl on Windows. - -Look for libeay32 and ssleay32 as another detection mechanism ---- - configure | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/configure b/configure -index a1818dc..1cf2a7c 100755 ---- a/configure -+++ b/configure -@@ -6127,6 +6127,7 @@ - check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto || - check_lib openssl openssl/ssl.h SSL_library_init -lssl32 -leay32 || - check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 || -+ check_lib openssl openssl/ssl.h SSL_library_init -llibeay32 -lssleay32 || - die "ERROR: openssl not found"; } - enabled rkmpp && { require_pkg_config rkmpp rockchip_mpp rockchip/rk_mpi.h mpp_create && - require_pkg_config rockchip_mpp "rockchip_mpp >= 1.3.7" rockchip/rk_mpi.h mpp_create && diff --git a/ports/ffmpeg/fix-debug-build.patch b/ports/ffmpeg/fix-debug-build.patch deleted file mode 100644 index 324eb79f9..000000000 --- a/ports/ffmpeg/fix-debug-build.patch +++ /dev/null @@ -1,30 +0,0 @@ -diff --git a/configure b/configure -index 7c5b8a1..181fc47 100644 ---- a/configure -+++ b/configure -@@ -3906,6 +3906,9 @@ for opt do - --libfuzzer=*) - libfuzzer_path="$optval" - ;; -+ --debug) -+ enable debug_configure -+ ;; - *) - optname="${opt%%=*}" - optname="${optname#--}" -@@ -6037,8 +6040,13 @@ fi - - enabled zlib && { check_pkg_config zlib zlib "zlib.h" zlibVersion || - check_lib zlib zlib.h zlibVersion -lz; } --enabled bzlib && check_lib bzlib bzlib.h BZ2_bzlibVersion -lbz2 --enabled lzma && check_lib lzma lzma.h lzma_version_number -llzma -+if enabled debug_configure; then -+ enabled bzlib && check_lib bzlib bzlib.h BZ2_bzlibVersion -lbz2d -+ enabled lzma && check_lib lzma lzma.h lzma_version_number -llzmad -+else -+ enabled bzlib && check_lib bzlib bzlib.h BZ2_bzlibVersion -lbz2 -+ enabled lzma && check_lib lzma lzma.h lzma_version_number -llzma -+fi - - # On some systems dynamic loading requires no extra linker flags - check_lib libdl dlfcn.h "dlopen dlsym" || check_lib libdl dlfcn.h "dlopen dlsym" -ldl diff --git a/ports/ffmpeg/fix_libvpx_windows_linking.patch b/ports/ffmpeg/fix_libvpx_windows_linking.patch deleted file mode 100644 index 805cd7e78..000000000 --- a/ports/ffmpeg/fix_libvpx_windows_linking.patch +++ /dev/null @@ -1,55 +0,0 @@ -diff --git "a/configure" "b/configure" -index c8be177..2fef830 100644 ---- "a/configure" -+++ "b/configure" -@@ -5098,6 +5098,8 @@ case "$arch" in - ;; - esac - -+libvpx_name=vpx -+ - # OS specific - case $target_os in - aix) -@@ -5269,6 +5271,15 @@ case $target_os in - enabled x86_64 && objformat="win64" || objformat="win32" - ranlib=: - enable dos_paths -+ if [ -z "${extra_cflags##*-MDd*}" ]; then -+ libvpx_name=vpxmdd -+ elif [ -z "${extra_cflags##*-MD*}" ]; then -+ libvpx_name=vpxmd -+ elif [ -z "${extra_cflags##*-MTd*}" ]; then -+ libvpx_name=vpxmtd -+ elif [ -z "${extra_cflags##*-MT*}" ]; then -+ libvpx_name=vpxmt -+ fi - ;; - cygwin*) - target_os=cygwin -@@ -6153,21 +6164,21 @@ enabled libvorbis && require_pkg_config libvorbis vorbis vorbis/codec.h - enabled libvpx && { - enabled libvpx_vp8_decoder && { - check_pkg_config libvpx_vp8_decoder "vpx >= 1.4.0" "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp8_dx || -- check_lib libvpx_vp8_decoder "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_dec_init_ver VPX_IMG_FMT_HIGHBITDEPTH" -lvpx || -+ check_lib libvpx_vp8_decoder "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_dec_init_ver VPX_IMG_FMT_HIGHBITDEPTH" -l$libvpx_name || - die "ERROR: libvpx decoder version must be >=1.4.0"; - } - enabled libvpx_vp8_encoder && { - check_pkg_config libvpx_vp8_encoder "vpx >= 1.4.0" "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp8_cx || -- check_lib libvpx_vp8_encoder "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver VPX_IMG_FMT_HIGHBITDEPTH" -lvpx || -+ check_lib libvpx_vp8_encoder "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver VPX_IMG_FMT_HIGHBITDEPTH" -l$libvpx_name || - die "ERROR: libvpx encoder version must be >=1.4.0"; - } - enabled libvpx_vp9_decoder && { - check_pkg_config libvpx_vp9_decoder "vpx >= 1.4.0" "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp9_dx || -- check_lib libvpx_vp9_decoder "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp9_dx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs" -+ check_lib libvpx_vp9_decoder "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp9_dx VPX_IMG_FMT_HIGHBITDEPTH" "-l$libvpx_name $libm_extralibs" - } - enabled libvpx_vp9_encoder && { - check_pkg_config libvpx_vp9_encoder "vpx >= 1.4.0" "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp9_cx || -- check_lib libvpx_vp9_encoder "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs" -+ check_lib libvpx_vp9_encoder "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx VPX_IMG_FMT_HIGHBITDEPTH" "-l$libvpx_name $libm_extralibs" - } - if disabled_all libvpx_vp8_decoder libvpx_vp9_decoder libvpx_vp8_encoder libvpx_vp9_encoder; then - die "libvpx enabled but no supported decoders found" diff --git a/ports/ffmpeg/fix_windowsinclude-in-ffmpegexe-1.patch b/ports/ffmpeg/fix_windowsinclude-in-ffmpegexe-1.patch deleted file mode 100644 index 09ee1219f..000000000 --- a/ports/ffmpeg/fix_windowsinclude-in-ffmpegexe-1.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/fftools/cmdutils.c 2017-07-29 19:49:29.000000000 +0200 -+++ b/fftools/cmdutils.c 2018-09-02 20:31:42.509408400 +0200 -@@ -62,6 +62,8 @@ - #include - #endif - #ifdef _WIN32 -+#define _WIN32_WINNT 0x0600 -+#define WIN32_LEAN_AND_MEAN - #include - #endif - diff --git a/ports/ffmpeg/fix_windowsinclude-in-ffmpegexe-2.patch b/ports/ffmpeg/fix_windowsinclude-in-ffmpegexe-2.patch deleted file mode 100644 index 69d725e2a..000000000 --- a/ports/ffmpeg/fix_windowsinclude-in-ffmpegexe-2.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/fftools/ffmpeg.c 2017-07-29 19:49:29.000000000 +0200 -+++ b/fftools/ffmpeg.c 2018-09-02 20:32:27.666725200 +0200 -@@ -23,6 +23,11 @@ - * multimedia converter based on the FFmpeg libraries - */ - -+#define _WIN32_WINNT 0x0502 // Must be less than 0x0600, because otherwise WinSock2.h defines "pollfd" which then gets redefined in "os_support.h". -+ // I suppose that "HAVE_STRUCT_POLLFD" should be 1, but it happens to be 0. Sorry, this is somewhat beyond me. -+#define WIN32_LEAN_AND_MEAN -+ -+ - #include "config.h" - #include - #include diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake index 079880ab3..394eb9cbc 100644 --- a/ports/ffmpeg/portfile.cmake +++ b/ports/ffmpeg/portfile.cmake @@ -1,21 +1,17 @@ include(vcpkg_common_functions) -vcpkg_download_distfile(ARCHIVE - URLS "http://ffmpeg.org/releases/ffmpeg-4.1.tar.bz2" - FILENAME "ffmpeg-4.1.tar.bz2" - SHA512 ccf6d07268dc47e08ca619eb182a003face2a8ee73ec1a28157330dd7de1df88939def1fc1c7e6b6ac7b59752cdad84657d589b2fafb73e14e5ef03fb6e33417 -) - -vcpkg_extract_source_archive_ex( +vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} + REPO ffmpeg/ffmpeg + REF n4.2 + SHA512 9fa56364696f91e2bf4287954d26f0c35b3f8aad241df3fbd3c9fc617235d8c83b28ddcac88436383b2eb273f690322e6f349e2f9c64d02f0058a4b76fa55035 + HEAD_REF master PATCHES - create-lib-libraries.patch - detect-openssl.patch - fix_windowsinclude-in-ffmpegexe-1.patch - fix_windowsinclude-in-ffmpegexe-2.patch - fix_libvpx_windows_linking.patch - fix-debug-build.patch + 0001-create-lib-libraries.patch + 0002-detect-openssl.patch + 0003-fix-windowsinclude.patch + 0004-fix-debug-build.patch + 0005-fix-libvpx-linking.patch ) if (${SOURCE_PATH} MATCHES " ") @@ -113,14 +109,18 @@ else() set(OPTIONS "${OPTIONS} --disable-opencl") endif() +set (ENABLE_LZMA OFF) if("lzma" IN_LIST FEATURES) set(OPTIONS "${OPTIONS} --enable-lzma") + set (ENABLE_LZMA ON) #necessary for configuring FFMPEG CMake Module else() set(OPTIONS "${OPTIONS} --disable-lzma") endif() +set (ENABLE_BZIP2 OFF) if("bzip2" IN_LIST FEATURES) set(OPTIONS "${OPTIONS} --enable-bzlib") + set (ENABLE_BZIP2 ON) #necessary for configuring FFMPEG CMake Module else() set(OPTIONS "${OPTIONS} --disable-bzlib") endif() @@ -151,11 +151,10 @@ if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") set(OPTIONS_CROSS " --enable-cross-compile --target-os=win32 --arch=${VCPKG_TARGET_ARCHITECTURE}") endif() -set(OPTIONS_DEBUG "") # Note: --disable-optimizations can't be used due to http://ffmpeg.org/pipermail/libav-user/2013-March/003945.html +set(OPTIONS_DEBUG "--debug") # Note: --disable-optimizations can't be used due to http://ffmpeg.org/pipermail/libav-user/2013-March/003945.html set(OPTIONS_RELEASE "") set(OPTIONS "${OPTIONS} ${OPTIONS_CROSS}") -set(OPTIONS "${OPTIONS} --extra-cflags=-DHAVE_UNISTD_H=0") if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") set(OPTIONS "${OPTIONS} --disable-static --enable-shared") @@ -164,20 +163,21 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") endif() endif() -message(STATUS "Building Options: ${OPTIONS}") - if(VCPKG_TARGET_IS_WINDOWS) + set(OPTIONS "${OPTIONS} --extra-cflags=-DHAVE_UNISTD_H=0") if(VCPKG_CRT_LINKAGE STREQUAL "dynamic") - set(OPTIONS_DEBUG "${OPTIONS_DEBUG} --extra-cflags=-MDd --extra-cxxflags=-MDd --debug") + set(OPTIONS_DEBUG "${OPTIONS_DEBUG} --extra-cflags=-MDd --extra-cxxflags=-MDd") set(OPTIONS_RELEASE "${OPTIONS_RELEASE} --extra-cflags=-MD --extra-cxxflags=-MD") else() - set(OPTIONS_DEBUG "${OPTIONS_DEBUG} --extra-cflags=-MTd --extra-cxxflags=-MTd --debug") + set(OPTIONS_DEBUG "${OPTIONS_DEBUG} --extra-cflags=-MTd --extra-cxxflags=-MTd") set(OPTIONS_RELEASE "${OPTIONS_RELEASE} --extra-cflags=-MT --extra-cxxflags=-MT") endif() endif() set(ENV_LIB_PATH "$ENV{${LIB_PATH_VAR}}") +message(STATUS "Building Options: ${OPTIONS}") + # Relase build if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL release) message(STATUS "Building Relase Options: ${OPTIONS_RELEASE}") @@ -256,5 +256,5 @@ vcpkg_copy_pdbs() # TODO: Examine build log and confirm that this license matches the build output file(INSTALL ${SOURCE_PATH}/COPYING.LGPLv2.1 DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) -file(COPY ${CMAKE_CURRENT_LIST_DIR}/FindFFMPEG.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) +configure_file(${CMAKE_CURRENT_LIST_DIR}/FindFFMPEG.cmake.in ${CURRENT_PACKAGES_DIR}/share/${PORT}/FindFFMPEG.cmake @ONLY) file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) -- cgit v1.2.3