diff options
| author | Matthew Oliver <protogonoi@gmail.com> | 2020-08-19 05:58:14 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-18 12:58:14 -0700 |
| commit | 272269583c80a4ba626d405e79a88a2ddd6d950d (patch) | |
| tree | aca2bd4c6ea94d1656e983492752ea33c2b0bb1e /ports/ffmpeg | |
| parent | bc8807963282a6b01f0e7ba94b732c5ec028d6a1 (diff) | |
| download | vcpkg-272269583c80a4ba626d405e79a88a2ddd6d950d.tar.gz vcpkg-272269583c80a4ba626d405e79a88a2ddd6d950d.zip | |
[ffmpeg] Add feature support for zlib, iconv, fdk-aac, mp3lame, opus, soxr, theora. (#11277)
Co-authored-by: Phoebe <20694052+PhoebeHui@users.noreply.github.com>
Diffstat (limited to 'ports/ffmpeg')
| -rw-r--r-- | ports/ffmpeg/0004-fix-debug-build.patch | 15 | ||||
| -rw-r--r-- | ports/ffmpeg/0006-fix-StaticFeatures.patch | 33 | ||||
| -rw-r--r-- | ports/ffmpeg/0007-fix-lib-naming.patch | 15 | ||||
| -rw-r--r-- | ports/ffmpeg/0008-Fix-wavpack-detection.patch | 27 | ||||
| -rw-r--r-- | ports/ffmpeg/0009-Fix-fdk-detection.patch | 14 | ||||
| -rw-r--r-- | ports/ffmpeg/0010-Fix-x264-detection.patch | 14 | ||||
| -rw-r--r-- | ports/ffmpeg/0011-Fix-x265-detection.patch | 16 | ||||
| -rw-r--r-- | ports/ffmpeg/0012-Fix-ssl-110-detection.patch | 13 | ||||
| -rw-r--r-- | ports/ffmpeg/CONTROL | 135 | ||||
| -rw-r--r-- | ports/ffmpeg/FindFFMPEG.cmake.in | 241 | ||||
| -rw-r--r-- | ports/ffmpeg/portfile.cmake | 249 |
11 files changed, 591 insertions, 181 deletions
diff --git a/ports/ffmpeg/0004-fix-debug-build.patch b/ports/ffmpeg/0004-fix-debug-build.patch index 6fe0780db..f1ea01e6b 100644 --- a/ports/ffmpeg/0004-fix-debug-build.patch +++ b/ports/ffmpeg/0004-fix-debug-build.patch @@ -12,7 +12,7 @@ index bd2de34..fba948a 100755 *) optname="${opt%%=*}" optname="${optname#--}" -@@ -6152,8 +6155,13 @@ fi +@@ -6152,8 +6153,13 @@ enabled zlib && { check_pkg_config zlib zlib "zlib.h" zlibVersion || check_lib zlib zlib.h zlibVersion -lz; } @@ -28,3 +28,16 @@ index bd2de34..fba948a 100755 # 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 +@@ -6350,7 +6350,11 @@ enabled librubberband && require_pkg_config librubberband "rubberband >= 1.8 + enabled libshine && require_pkg_config libshine shine shine/layer3.h shine_encode_buffer + enabled libsmbclient && { check_pkg_config libsmbclient smbclient libsmbclient.h smbc_init || + require libsmbclient libsmbclient.h smbc_init -lsmbclient; } +-enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++ ++if enabled debug_configure; then ++ enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappyd -lstdc++ ++else ++ enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++ ++fi + enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr + enabled libssh && require_pkg_config libssh libssh libssh/sftp.h sftp_init + enabled libspeex && require_pkg_config libspeex speex speex/speex.h speex_decoder_init diff --git a/ports/ffmpeg/0006-fix-StaticFeatures.patch b/ports/ffmpeg/0006-fix-StaticFeatures.patch index 9fffd9d7e..bec030368 100644 --- a/ports/ffmpeg/0006-fix-StaticFeatures.patch +++ b/ports/ffmpeg/0006-fix-StaticFeatures.patch @@ -2,15 +2,35 @@ diff --git a/configure b/configure index 3bdcfc6..00b2f13 100644 --- a/configure +++ b/configure -@@ -6360,6 +6360,7 @@ enabled openal && { { for al_extralibs in "${OPENAL_LIBS}" "-lopenal" +@@ -6251,7 +6251,8 @@ if enabled libmfx; then + enabled libmfx && { check_pkg_config libmfx libmfx "mfx/mfxvideo.h" MFXInit || + { require libmfx "mfx/mfxvideo.h" MFXInit "-llibmfx $advapi32_extralibs" && warn "using libmfx without pkg-config"; } } + enabled libmodplug && require_pkg_config libmodplug libmodplug libmodplug/modplug.h ModPlug_Load +-enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame $libm_extralibs ++enabled libmp3lame && { check_lib libmp3lame lame/lame.h lame_set_VBR_quality -lmp3lame $libm_extralibs || ++ require libmp3lame lame/lame.h lame_set_VBR_quality -llibmp3lame-static -llibmpghip-static $libm_extralibs; } + enabled libmysofa && { check_pkg_config libmysofa libmysofa mysofa.h mysofa_load || + require libmysofa mysofa.h mysofa_load -lmysofa $zlib_extralibs; } + enabled libnpp && { check_lib libnpp npp.h nppGetLibVersion -lnppig -lnppicc -lnppc -lnppidei || +@@ -6292,7 +6293,7 @@ if enabled debug_configure; then + else + enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++ + fi +-enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr ++enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr -lm + enabled libssh && require_pkg_config libssh libssh libssh/sftp.h sftp_init + enabled libspeex && require_pkg_config libspeex speex speex/speex.h speex_decoder_init + enabled libsrt && require_pkg_config libsrt "srt >= 1.3.0" srt/srt.h srt_socket +@@ -6360,6 +6361,8 @@ enabled openal && { { for al_extralibs in "${OPENAL_LIBS}" "-lopenal" enabled opencl && { check_pkg_config opencl OpenCL CL/cl.h clEnqueueNDRangeKernel || check_lib opencl OpenCL/cl.h clEnqueueNDRangeKernel -Wl,-framework,OpenCL || check_lib opencl CL/cl.h clEnqueueNDRangeKernel -lOpenCL || + check_lib opencl CL/cl.h clEnqueueNDRangeKernel -lOpenCL -lAdvapi32 -lOle32 -lCfgmgr32|| ++ check_lib opencl CL/cl.h clEnqueueNDRangeKernel -lOpenCL -pthread -ldl || die "ERROR: opencl not found"; } && { test_cpp_condition "OpenCL/cl.h" "defined(CL_VERSION_1_2)" || test_cpp_condition "CL/cl.h" "defined(CL_VERSION_1_2)" || -@@ -6379,6 +6380,7 @@ enabled openssl && { check_pkg_config openssl openssl openssl/ssl.h OP +@@ -6379,6 +6382,7 @@ 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 || @@ -18,3 +38,12 @@ index 3bdcfc6..00b2f13 100644 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 && +@@ -6707,7 +6711,7 @@ enabled amf && + if enabled libc_iconv; then + check_func_headers iconv.h iconv + elif enabled iconv; then +- check_func_headers iconv.h iconv || check_lib iconv iconv.h iconv -liconv ++ check_func_headers iconv.h iconv || check_lib iconv iconv.h iconv -liconv || check_lib iconv iconv.h iconv -liconv -llibcharset + fi + + enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel" diff --git a/ports/ffmpeg/0007-fix-lib-naming.patch b/ports/ffmpeg/0007-fix-lib-naming.patch new file mode 100644 index 000000000..c9fb9db21 --- /dev/null +++ b/ports/ffmpeg/0007-fix-lib-naming.patch @@ -0,0 +1,15 @@ +diff --git a/configure b/configure +index d6c4388..75b96c3 100644 +--- a/configure ++++ b/configure +@@ -4378,6 +4378,10 @@ msvc_common_flags(){ + -march=*) ;; + -lz) echo zlib.lib ;; + -lx264) echo libx264.lib ;; ++ -lx265) echo libx265.lib ;; ++ -lmp3lame) echo libmp3lame.lib ;; ++ -liconv) echo libiconv.lib ;; ++ -lm) ;; + -lstdc++) ;; + -l*) echo ${flag#-l}.lib ;; + -LARGEADDRESSAWARE) echo $flag ;; diff --git a/ports/ffmpeg/0008-Fix-wavpack-detection.patch b/ports/ffmpeg/0008-Fix-wavpack-detection.patch new file mode 100644 index 000000000..959ee8a1b --- /dev/null +++ b/ports/ffmpeg/0008-Fix-wavpack-detection.patch @@ -0,0 +1,27 @@ +diff --git a/configure b/configure +index e7162dbc56..0f04af2a81 100755 +--- a/configure ++++ b/configure +@@ -6391,7 +6391,7 @@ enabled libvpx && { + fi + } + +-enabled libwavpack && require libwavpack wavpack/wavpack.h WavpackOpenFileOutput -lwavpack ++enabled libwavpack && { check_pkg_config libwavpack wavpack wavpack.h WavpackOpenFileOutput || check_lib libwavpack wavpack.h WavpackOpenFileOutput -lwavpack || check_lib libwavpack wavpack.h WavpackOpenFileOutput -llibwavpack || require libwavpack wavpack.h WavpackOpenFileOutput -lwavpackdll; } + enabled libwebp && { + enabled libwebp_encoder && require_pkg_config libwebp "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion + enabled libwebp_anim_encoder && check_pkg_config libwebp_anim_encoder "libwebpmux >= 0.4.0" webp/mux.h WebPAnimEncoderOptionsInit; } +diff --git a/libavcodec/libwavpackenc.c b/libavcodec/libwavpackenc.c +index e84b074893..9adf39861b 100644 +--- a/libavcodec/libwavpackenc.c ++++ b/libavcodec/libwavpackenc.c +@@ -16,7 +16,7 @@ + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +-#include <wavpack/wavpack.h> ++#include <wavpack.h> + #include <string.h> + + #include "libavutil/attributes.h" + diff --git a/ports/ffmpeg/0009-Fix-fdk-detection.patch b/ports/ffmpeg/0009-Fix-fdk-detection.patch new file mode 100644 index 000000000..3d280fd2b --- /dev/null +++ b/ports/ffmpeg/0009-Fix-fdk-detection.patch @@ -0,0 +1,14 @@ +diff --git a/configure b/configure +index b137669dd3..34c92230f4 100755 +--- a/configure ++++ b/configure +@@ -6331,7 +6331,7 @@ enabled libdavs2 && require_pkg_config libdavs2 "davs2 >= 1.6.0" davs2. + enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2 dc1394/dc1394.h dc1394_new + enabled libdrm && require_pkg_config libdrm libdrm xf86drm.h drmGetVersion + enabled libfdk_aac && { check_pkg_config libfdk_aac fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen || +- { require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac && ++ { require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac -lm -lstdc++ && + warn "using libfdk without pkg-config"; } } + flite_extralibs="-lflite_cmu_time_awb -lflite_cmu_us_awb -lflite_cmu_us_kal -lflite_cmu_us_kal16 -lflite_cmu_us_rms -lflite_cmu_us_slt -lflite_usenglish -lflite_cmulex -lflite" + enabled libflite && require libflite "flite/flite.h" flite_init $flite_extralibs + diff --git a/ports/ffmpeg/0010-Fix-x264-detection.patch b/ports/ffmpeg/0010-Fix-x264-detection.patch new file mode 100644 index 000000000..2cbf85eaf --- /dev/null +++ b/ports/ffmpeg/0010-Fix-x264-detection.patch @@ -0,0 +1,14 @@ +diff --git a/configure b/configure +index b137669dd3..34a2e644c4 100755 +--- a/configure ++++ b/configure +@@ -6443,7 +6443,7 @@ enabled libwebp && { + enabled libwebp_encoder && require_pkg_config libwebp "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion + enabled libwebp_anim_encoder && check_pkg_config libwebp_anim_encoder "libwebpmux >= 0.4.0" webp/mux.h WebPAnimEncoderOptionsInit; } + enabled libx264 && { check_pkg_config libx264 x264 "stdint.h x264.h" x264_encoder_encode || +- { require libx264 "stdint.h x264.h" x264_encoder_encode "-lx264 $pthreads_extralibs $libm_extralibs" && ++ { require libx264 "stdint.h x264.h" x264_encoder_encode "-lx264 $pthreads_extralibs $libm_extralibs -ldl" && + warn "using libx264 without pkg-config"; } } && + require_cpp_condition libx264 x264.h "X264_BUILD >= 118" && + check_cpp_condition libx262 x264.h "X264_MPEG2" + diff --git a/ports/ffmpeg/0011-Fix-x265-detection.patch b/ports/ffmpeg/0011-Fix-x265-detection.patch new file mode 100644 index 000000000..54a216ac2 --- /dev/null +++ b/ports/ffmpeg/0011-Fix-x265-detection.patch @@ -0,0 +1,16 @@ +diff --git a/configure b/configure +index 34a2e644c4..0ea64bd306 100755 +--- a/configure ++++ b/configure +@@ -6447,7 +6447,9 @@ enabled libx264 && { check_pkg_config libx264 x264 "stdint.h x264.h" x + warn "using libx264 without pkg-config"; } } && + require_cpp_condition libx264 x264.h "X264_BUILD >= 118" && + check_cpp_condition libx262 x264.h "X264_MPEG2" +-enabled libx265 && require_pkg_config libx265 x265 x265.h x265_api_get && ++enabled libx265 && { check_pkg_config libx265 x265 x265.h x265_api_get || ++ { require libx265 x265.h x265_api_get "-lx265 $pthreads_extralibs $libm_extralibs -ldl -lstdc++ -lgcc_s -lgcc -lrt -lnuma" && ++ warn "using libx265 without pkg-config"; } } && + require_cpp_condition libx265 x265.h "X265_BUILD >= 68" + enabled libxavs && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs" + enabled libxavs2 && require_pkg_config libxavs2 "xavs2 >= 1.3.0" "stdint.h xavs2.h" xavs2_api_get + diff --git a/ports/ffmpeg/0012-Fix-ssl-110-detection.patch b/ports/ffmpeg/0012-Fix-ssl-110-detection.patch new file mode 100644 index 000000000..b8666e6b0 --- /dev/null +++ b/ports/ffmpeg/0012-Fix-ssl-110-detection.patch @@ -0,0 +1,13 @@ +diff --git a/configure b/configure +index 2be953f7e7..e075949ffc 100755 +--- a/configure ++++ b/configure +@@ -6497,6 +6497,7 @@ enabled omx_rpi && { test_code cc OMX_Core.h OMX_IndexConfigBrcmVideoR + die "ERROR: OpenMAX IL headers not found"; } && enable omx + enabled openssl && { check_pkg_config openssl openssl openssl/ssl.h OPENSSL_init_ssl || + check_pkg_config openssl openssl openssl/ssl.h SSL_library_init || ++ check_lib openssl openssl/ssl.h OPENSSL_init_ssl -lssl -lcrypto $pthreads_extralibs -ldl || + 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 || + diff --git a/ports/ffmpeg/CONTROL b/ports/ffmpeg/CONTROL index a2a905b2c..44f63079c 100644 --- a/ports/ffmpeg/CONTROL +++ b/ports/ffmpeg/CONTROL @@ -1,11 +1,10 @@ Source: ffmpeg Version: 4.2 -Port-Version: 18 -Build-Depends: zlib +Port-Version: 20 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, avcodec, avformat, avdevice, avfilter, swresample, swscale +Default-Features: avresample, avcodec, avformat, avdevice, avfilter, postproc, swresample, swscale Feature: ffmpeg Description: build the ffmpeg.exe application @@ -14,34 +13,35 @@ Feature: ffserver Description: ffserver appplication support in ffmpeg Feature: ffplay +Build-Depends: ffmpeg[sdl2] Description: ffplay appplication support in ffmpeg Feature: ffprobe Description: ffprobe appplication support in ffmpeg -Feature: openssl -Build-Depends: openssl, ffmpeg[nonfree] -Description: openssl support in ffmpeg +Feature: avcodec +Description: Codec support in ffmpeg -Feature: lzma -Build-Depends: liblzma -Description: lzma support in ffmpeg +Feature: avformat +Description: Format support in ffmpeg -Feature: bzip2 -Build-Depends: bzip2 -Description: bzip2 support in ffmpeg +Feature: avdevice +Description: Device support in ffmpeg -Feature: vpx -Build-Depends: libvpx -Description: WebM VP8/VP9 support in ffmpeg +Feature: avfilter +Description: Filter support in ffmpeg -Feature: x264 -Build-Depends: x264, ffmpeg[gpl] -Description: x264 support in ffmpeg +Feature: postproc +Description: Postproc support in ffmpeg -Feature: opencl -Build-Depends: opencl -Description: opencl support in ffmpeg +Feature: swresample +Description: Swresample support in ffmpeg + +Feature: swscale +Description: Swscale support in ffmpeg + +Feature: avresample +Description: Libav audio resampling library support in ffmpeg Feature: nonfree Description: allow nonfree and unredistributable libraries @@ -52,31 +52,86 @@ Description: allow GPL licensed libraries Feature: version3 Description: upgrade (L)GPL to version 3 -Feature: avresample -Description: Libav audio resampling library support in ffmpeg - -Feature: avcodec -Description: Codec support in ffmpeg +Feature: avisynthplus +Build-Depends: avisynthplus, ffmpeg[gpl] +Description: avisynthplus support in ffmpeg -Feature: avformat -Description: Format support in ffmpeg +Feature: bzip2 +Build-Depends: bzip2 +Description: bzip2 support in ffmpeg -Feature: avdevice -Description: Device support in ffmpeg +Feature: iconv +Build-Depends: libiconv +Description: iconv support in ffmpeg -Feature: avfilter -Description: Filter support in ffmpeg +Feature: fdk-aac +Build-Depends: fdk-aac, ffmpeg[nonfree] +Description: AAC de/encoding via libfdk-aac support in ffmpeg -Feature: swresample -Description: Swresample support in ffmpeg +Feature: lzma +Build-Depends: liblzma +Description: lzma support in ffmpeg -Feature: swscale -Description: Swscale support in ffmpeg +Feature: mp3lame +Build-Depends: mp3lame +Description: MP3 encoding via libmp3lame support in ffmpeg Feature: nvcodec -Build-Depends: ffnvcodec, cuda +Build-Depends: ffnvcodec Description: Hardware accelerated codecs -Feature: avisynthplus -Build-Depends: avisynthplus, ffmpeg[gpl] -Description: avisynthplus support in ffmpeg +Feature: opencl +Build-Depends: opencl +Description: OpenCL processing support in ffmpeg + +Feature: openssl +Build-Depends: openssl, ffmpeg[nonfree] +Description: openssl support in ffmpeg + +Feature: opus +Build-Depends: opus +Description: Opus de/encoding via libopus support in ffmpeg + +Feature: sdl2 +Build-Depends: sdl2 +Description: sdl2 support in ffmpeg + +Feature: snappy +Build-Depends: snappy +Description: Snappy compression, needed for hap encoding support in ffmpeg + +Feature: soxr +Build-Depends: soxr +Description: libsoxr resampling support in ffmpeg + +Feature: speex +Build-Depends: speex +Description: Speex de/encoding via libspeex support in ffmpeg + +Feature: theora +Build-Depends: libtheora +Description: Theora encoding via libtheora support in ffmpeg + +Feature: vorbis +Build-Depends: libvorbis +Description: Vorbis en/decoding via libvorbis support in ffmpeg + +Feature: vpx +Build-Depends: libvpx +Description: VP8 and VP9 de/encoding via libvpx support in ffmpeg + +Feature: wavpack +Build-Depends: wavpack +Description: wavpack encoding via libwavpack support in ffmpeg + +Feature: x264 +Build-Depends: x264, ffmpeg[gpl] +Description: H.264 encoding via x264 support in ffmpeg + +Feature: x265 +Build-Depends: x265, ffmpeg[gpl] +Description: HEVC encoding via x265 support in ffmpeg + +Feature: zlib +Build-Depends: zlib +Description: zlib support in ffmpeg diff --git a/ports/ffmpeg/FindFFMPEG.cmake.in b/ports/ffmpeg/FindFFMPEG.cmake.in index 5fbd9963d..5eee6e73f 100644 --- a/ports/ffmpeg/FindFFMPEG.cmake.in +++ b/ports/ffmpeg/FindFFMPEG.cmake.in @@ -33,11 +33,7 @@ set(FFMPEG_VERSION "4.2") find_dependency(Threads) if(UNIX) - list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS -pthread) -endif() - -if(UNIX AND NOT APPLE) - list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS -lX11) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS -pthread -lX11) endif() if(@ENABLE_BZIP2@) @@ -47,61 +43,182 @@ if(@ENABLE_BZIP2@) list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$<CONFIG:Debug>:${BZip2_LIBRARY_DEBUG}>$<$<CONFIG:Release>:${BZip2_LIBRARY_RELEASE}>") endif() +if(@ENABLE_ICONV@) + find_dependency(unofficial-iconv) + get_target_property(ICONV_LIBRARY_RELEASE unofficial::iconv::libiconv IMPORTED_LOCATION_RELEASE) + get_target_property(ICONV_LIBRARY_DEBUG unofficial::iconv::libiconv IMPORTED_LOCATION_DEBUG) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$<CONFIG:Debug>:${ICONV_LIBRARY_DEBUG}>$<$<CONFIG:Release>:${ICONV_LIBRARY_RELEASE}>") +endif() + +if(@ENABLE_FDKAAC@) + find_library(FDK_LIBRARY_RELEASE NAMES fdk-aac libfdk-aac PATHS ${_IMPORT_PREFIX}/lib/ NO_DEFAULT_PATH) + find_library(FDK_LIBRARY_DEBUG NAMES fdk-aac libfdk-aac PATHS ${_IMPORT_PREFIX}/debug/lib/ NO_DEFAULT_PATH) + select_library_configurations(FDK) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$<CONFIG:Debug>:${FDK_LIBRARY_DEBUG}>$<$<CONFIG:Release>:${FDK_LIBRARY_RELEASE}>") +endif() + if(@ENABLE_LZMA@) find_dependency(LibLZMA) list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$<CONFIG:Debug>:${LibLZMA_LIBRARY_DEBUG}>$<$<CONFIG:Release>:${LibLZMA_LIBRARY_RELEASE}>") endif() +if(@ENABLE_LAME@) + find_dependency(mp3lame) + get_target_property(LAME_LIBRARY_RELEASE mp3lame::mp3lame IMPORTED_LOCATION_RELEASE) + get_target_property(LAME_LIBRARY_DEBUG mp3lame::mp3lame IMPORTED_LOCATION_DEBUG) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$<CONFIG:Debug>:${LAME_LIBRARY_DEBUG}>$<$<CONFIG:Release>:${LAME_LIBRARY_RELEASE}>") +endif() + +if(@ENABLE_OPENCL@) + find_dependency(OpenCL) + get_target_property(OPENCL_LIBRARY_RELEASE OpenCL::OpenCL IMPORTED_LOCATION_RELEASE) + get_target_property(OPENCL_LIBRARY_DEBUG OpenCL::OpenCL IMPORTED_LOCATION_DEBUG) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$<CONFIG:Debug>:${OPENCL_LIBRARY_DEBUG}>$<$<CONFIG:Release>:${OPENCL_LIBRARY_RELEASE}>") +endif() + +if(@ENABLE_OPENSSL@) + find_dependency(OpenSSL) + get_target_property(LIBSSL_LIBRARY_RELEASE OpenSSL::SSL IMPORTED_LOCATION_RELEASE) + get_target_property(LIBSSL_LIBRARY_DEBUG OpenSSL::SSL IMPORTED_LOCATION_DEBUG) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$<CONFIG:Debug>:${LIBSSL_LIBRARY_DEBUG}>$<$<CONFIG:Release>:${LIBSSL_LIBRARY_RELEASE}>") + get_target_property(LIBCRYPTO_LIBRARY_RELEASE OpenSSL::Crypto IMPORTED_LOCATION_RELEASE) + get_target_property(LIBCRYPTO_LIBRARY_DEBUG OpenSSL::Crypto IMPORTED_LOCATION_DEBUG) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$<CONFIG:Debug>:${LIBCRYPTO_LIBRARY_DEBUG}>$<$<CONFIG:Release>:${LIBCRYPTO_LIBRARY_RELEASE}>") +endif() + +if(@ENABLE_OPUS@) + find_dependency(Opus) + get_target_property(OPUS_LIBRARY_RELEASE Opus::opus IMPORTED_LOCATION_RELEASE) + get_target_property(OPUS_LIBRARY_DEBUG Opus::opus IMPORTED_LOCATION_DEBUG) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$<CONFIG:Debug>:${OPUS_LIBRARY_DEBUG}>$<$<CONFIG:Release>:${OPUS_LIBRARY_RELEASE}>") +endif() + +if(@ENABLE_SDL2@) + find_dependency(SDL2) + get_target_property(SDL2_LIBRARY_RELEASE SDL2::SDL2 IMPORTED_LOCATION_RELEASE) + get_target_property(SDL2_LIBRARY_DEBUG SDL2::SDL2 IMPORTED_LOCATION_DEBUG) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$<CONFIG:Debug>:${SDL2_LIBRARY_DEBUG}>$<$<CONFIG:Release>:${SDL2_LIBRARY_RELEASE}>") +endif() + +if(@ENABLE_SNAPPY@) + find_dependency(Snappy) + get_target_property(SNAPPY_LIBRARY_RELEASE Snappy::snappy IMPORTED_LOCATION_RELEASE) + get_target_property(SNAPPY_LIBRARY_DEBUG Snappy::snappy IMPORTED_LOCATION_DEBUG) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$<CONFIG:Debug>:${SNAPPY_LIBRARY_DEBUG}>$<$<CONFIG:Release>:${SNAPPY_LIBRARY_RELEASE}>") +endif() + +if(@ENABLE_SOXR@) + find_library(SOXR_LIBRARY_RELEASE NAMES soxr PATHS ${_IMPORT_PREFIX}/lib/ NO_DEFAULT_PATH) + find_library(SOXR_LIBRARY_DEBUG NAMES soxr PATHS ${_IMPORT_PREFIX}/debug/lib/ NO_DEFAULT_PATH) + select_library_configurations(SOXR) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$<CONFIG:Debug>:${SOXR_LIBRARY_DEBUG}>$<$<CONFIG:Release>:${SOXR_LIBRARY_RELEASE}>") +endif() + +if(@ENABLE_SPEEX@) + find_library(SPEEX_LIBRARY_RELEASE NAMES speex libspeex PATHS ${_IMPORT_PREFIX}/lib/ NO_DEFAULT_PATH) + find_library(SPEEX_LIBRARY_DEBUG NAMES speex libspeex PATHS ${_IMPORT_PREFIX}/debug/lib/ NO_DEFAULT_PATH) + select_library_configurations(SPEEX) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$<CONFIG:Debug>:${SPEEX_LIBRARY_DEBUG}>$<$<CONFIG:Release>:${SPEEX_LIBRARY_RELEASE}>") +endif() + +if(@ENABLE_THEORA@) + find_library(THEORA_LIBRARY_RELEASE NAMES theora PATHS ${_IMPORT_PREFIX}/lib/ NO_DEFAULT_PATH) + find_library(THEORA_LIBRARY_DEBUG NAMES theora PATHS ${_IMPORT_PREFIX}/debug/lib/ NO_DEFAULT_PATH) + select_library_configurations(SPEEX) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$<CONFIG:Debug>:${THEORA_LIBRARY_DEBUG}>$<$<CONFIG:Release>:${THEORA_LIBRARY_RELEASE}>") +endif() + +if(@ENABLE_VORBIS@) + find_dependency(Vorbis) + get_target_property(VORBIS_LIBRARY_RELEASE Vorbis::vorbis IMPORTED_LOCATION_RELEASE) + get_target_property(VORBIS_LIBRARY_DEBUG Vorbis::vorbis IMPORTED_LOCATION_DEBUG) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$<CONFIG:Debug>:${VORBIS_LIBRARY_DEBUG}>$<$<CONFIG:Release>:${VORBIS_LIBRARY_RELEASE}>") + get_target_property(VORBISENC_LIBRARY_RELEASE Vorbis::vorbisenc IMPORTED_LOCATION_RELEASE) + get_target_property(VORBISENC_LIBRARY_DEBUG Vorbis::vorbisenc IMPORTED_LOCATION_DEBUG) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$<CONFIG:Debug>:${VORBISENC_LIBRARY_DEBUG}>$<$<CONFIG:Release>:${VORBISENC_LIBRARY_RELEASE}>") + get_target_property(VORBIS_DEP_LIBRARIES Vorbis::vorbis INTERFACE_LINK_LIBRARIES) + foreach(deps ${VORBIS_DEP_LIBRARIES}) + if(TARGET ${deps}) + get_target_property(VORBIS_DEP_LIBRARY_RELEASE ${deps} IMPORTED_LOCATION_RELEASE) + get_target_property(VORBIS_DEP_LIBRARY_DEBUG ${deps} INTERFACE_LINK_LIBRARIES) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$<CONFIG:Debug>:${VORBIS_DEP_LIBRARY_DEBUG}>$<$<CONFIG:Release>:${VORBIS_DEP_LIBRARY_RELEASE}>") + endif() + endforeach() +endif() + +if(@ENABLE_VPX@) + find_dependency(unofficial-libvpx) + get_target_property(VPX_LIBRARY_RELEASE unofficial::libvpx::libvpx IMPORTED_LOCATION_RELEASE) + get_target_property(VPX_LIBRARY_DEBUG unofficial::libvpx::libvpx IMPORTED_LOCATION_DEBUG) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$<CONFIG:Debug>:${VPX_LIBRARY_DEBUG}>$<$<CONFIG:Release>:${VPX_LIBRARY_RELEASE}>") +endif() + +if(@ENABLE_WAVPACK@) + find_dependency(wavpack) + get_target_property(WAVPACK_LIBRARY_RELEASE WavPack::wavpack IMPORTED_LOCATION_RELEASE) + get_target_property(WAVPACK_LIBRARY_DEBUG WavPack::wavpack IMPORTED_LOCATION_DEBUG) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$<CONFIG:Debug>:${WAVPACK_LIBRARY_DEBUG}>$<$<CONFIG:Release>:${WAVPACK_LIBRARY_RELEASE}>") +endif() + +if(@ENABLE_X264@) + find_library(X264_LIBRARY_RELEASE NAMES x264 libx264 PATHS ${_IMPORT_PREFIX}/lib/ NO_DEFAULT_PATH) + find_library(X264_LIBRARY_DEBUG NAMES x264 libx264 PATHS ${_IMPORT_PREFIX}/debug/lib/ NO_DEFAULT_PATH) + select_library_configurations(X264) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$<CONFIG:Debug>:${X264_LIBRARY_DEBUG}>$<$<CONFIG:Release>:${X264_LIBRARY_RELEASE}>") +endif() + +if(@ENABLE_X265@) + find_library(X265_LIBRARY_RELEASE NAMES x265 x265-static PATHS ${_IMPORT_PREFIX}/lib/ NO_DEFAULT_PATH) + find_library(X265_LIBRARY_DEBUG NAMES x265 x265-static PATHS ${_IMPORT_PREFIX}/debug/lib/ NO_DEFAULT_PATH) + select_library_configurations(X265) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$<CONFIG:Debug>:${X265_LIBRARY_DEBUG}>$<$<CONFIG:Release>:${X265_LIBRARY_RELEASE}>") +endif() + +if(@ENABLE_ZLIB@) + find_dependency(ZLIB) + get_target_property(ZLIB_LIBRARY_RELEASE ZLIB::ZLIB IMPORTED_LOCATION_RELEASE) + get_target_property(ZLIB_LIBRARY_DEBUG ZLIB::ZLIB IMPORTED_LOCATION_DEBUG) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$<CONFIG:Debug>:${ZLIB_LIBRARY_DEBUG}>$<$<CONFIG:Release>:${ZLIB_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) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS wsock32 ws2_32 secur32 bcrypt strmiids Vfw32 Shlwapi) endif() else() list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS m) endif() +# Compute the installation prefix relative to this file. +get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +if(_IMPORT_PREFIX STREQUAL "/") + set(_IMPORT_PREFIX "") +endif() + +set(_IMPORT_PREFIX) + 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) + find_path(FFMPEG_${varname}_INCLUDE_DIRS NAMES lib${shortname}/${headername} ${headername} PATHS ${_IMPORT_PREFIX}/include NO_DEFAULT_PATH) endif() if(NOT FFMPEG_${varname}_LIBRARY) - find_library(FFMPEG_${varname}_LIBRARY_RELEASE NAMES ${shortname} PATH_SUFFIXES ffmpeg ffmpeg/lib) + find_library(FFMPEG_${varname}_LIBRARY_RELEASE NAMES ${shortname} PATHS ${_IMPORT_PREFIX}/lib/ NO_DEFAULT_PATH) + find_library(FFMPEG_${varname}_LIBRARY_DEBUG NAMES ${shortname} PATHS ${_IMPORT_PREFIX}/debug/lib/ NO_DEFAULT_PATH) 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) + set(FFMPEG_${varname}_FOUND TRUE BOOL) + list(APPEND FFMPEG_INCLUDE_DIRS ${FFMPEG_${varname}_INCLUDE_DIRS}) + list(APPEND FFMPEG_LIBRARIES ${FFMPEG_${varname}_LIBRARY}) 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_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) @@ -146,68 +263,28 @@ endif() if(@ENABLE_AVRESAMPLE@) FFMPEG_FIND(libavresample avresample avresample.h) endif() -FFMPEG_FIND(libavutil avutil avutil.h) +FFMPEG_FIND(libavutil avutil avutil.h) +if(@ENABLE_POSTPROC@) + FFMPEG_FIND(libpostproc postproc postprocess.h) +endif() if(@ENABLE_SWRESAMPLE@) FFMPEG_FIND(libswresample swresample swresample.h) endif() if(@ENABLE_SWSCALE@) FFMPEG_FIND(libswscale swscale swscale.h) -endif(@ENABLE_SWSCALE@) +endif() -if (FFMPEG_libavutil_FOUND AND FFMPEG_libzlib_FOUND) - list(APPEND FFMPEG_INCLUDE_DIRS ${FFMPEG_libavutil_INCLUDE_DIRS}) - if(FFMPEG_libavcodec_FOUND) - list(APPEND FFMPEG_INCLUDE_DIRS ${FFMPEG_libavcodec_INCLUDE_DIRS}) - endif() - if(FFMPEG_libavdevice_FOUND) - list(APPEND FFMPEG_INCLUDE_DIRS ${FFMPEG_libavdevice_INCLUDE_DIRS}) - endif() - if(FFMPEG_libavformat_FOUND) - list(APPEND FFMPEG_INCLUDE_DIRS ${FFMPEG_libavformat_INCLUDE_DIRS}) - endif() - if(FFMPEG_libswscale_FOUND) - list(APPEND FFMPEG_INCLUDE_DIRS ${FFMPEG_libswscale_INCLUDE_DIRS}) - endif() +if (FFMPEG_libavutil_FOUND) list(REMOVE_DUPLICATES FFMPEG_INCLUDE_DIRS) list(REMOVE_DUPLICATES FFMPEG_LIBRARY_DIRS) - if(FFMPEG_libavcodec_FOUND) - set(FFMPEG_libavcodec_VERSION "${FFMPEG_VERSION}" CACHE STRING "") - endif() - if(FFMPEG_libavdevice_FOUND) - set(FFMPEG_libavdevice_VERSION "${FFMPEG_VERSION}" CACHE STRING "") - endif() - if(FFMPEG_libavfilter_FOUND) - set(FFMPEG_libavfilter_VERSION "${FFMPEG_VERSION}" CACHE STRING "") - endif() - if(FFMPEG_libavformat_FOUND) - set(FFMPEG_libavformat_VERSION "${FFMPEG_VERSION}" CACHE STRING "") - endif() - if(FFMPEG_libavresample_FOUND) - set(FFMPEG_libavresample_VERSION "${FFMPEG_VERSION}" CACHE STRING "") - endif() - set(FFMPEG_libavutil_VERSION "${FFMPEG_VERSION}" CACHE STRING "") - if(FFMPEG_libswresample_FOUND) - set(FFMPEG_libswresample_VERSION "${FFMPEG_VERSION}" CACHE STRING "") - endif() - if(FFMPEG_libswscale_FOUND) - set(FFMPEG_libswscale_VERSION "${FFMPEG_VERSION}" CACHE STRING "") - endif() - list(APPEND FFMPEG_LIBRARIES - ${FFMPEG_libavdevice_LIBRARY} - ${FFMPEG_libavfilter_LIBRARY} - ${FFMPEG_libavformat_LIBRARY} - ${FFMPEG_libswscale_LIBRARY} - ${FFMPEG_libavcodec_LIBRARY} - ${FFMPEG_libswresample_LIBRARY} - ${FFMPEG_libavresample_LIBRARY} - ${FFMPEG_libavutil_LIBRARY} - ${FFMPEG_libzlib_LIBRARY} ${FFMPEG_PLATFORM_DEPENDENT_LIBS} ) + set(FFMPEG_LIBRARY ${FFMPEG_LIBRARIES}) + set(FFMPEG_FOUND TRUE CACHE BOOL "") 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 "") diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake index 86fd3e5d9..652e26cda 100644 --- a/ports/ffmpeg/portfile.cmake +++ b/ports/ffmpeg/portfile.cmake @@ -10,6 +10,12 @@ vcpkg_from_github( 0004-fix-debug-build.patch 0005-fix-libvpx-linking.patch 0006-fix-StaticFeatures.patch + 0007-fix-lib-naming.patch + 0008-Fix-wavpack-detection.patch + 0009-Fix-fdk-detection.patch + 0010-Fix-x264-detection.patch + 0011-Fix-x265-detection.patch + 0012-Fix-ssl-110-detection.patch ) if (${SOURCE_PATH} MATCHES " ") @@ -36,9 +42,9 @@ if(VCPKG_TARGET_IS_WINDOWS) set(BUILD_SCRIPT ${CMAKE_CURRENT_LIST_DIR}\\build.sh) if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") - vcpkg_acquire_msys(MSYS_ROOT PACKAGES perl gcc diffutils make) + vcpkg_acquire_msys(MSYS_ROOT PACKAGES perl gcc diffutils make pkg-config) else() - vcpkg_acquire_msys(MSYS_ROOT PACKAGES diffutils make) + vcpkg_acquire_msys(MSYS_ROOT PACKAGES diffutils make pkg-config) endif() set(BASH ${MSYS_ROOT}/usr/bin/bash.exe) @@ -69,12 +75,6 @@ if("version3" IN_LIST FEATURES) set(OPTIONS "${OPTIONS} --enable-version3") endif() -if("openssl" IN_LIST FEATURES) - set(OPTIONS "${OPTIONS} --enable-openssl") -else() - set(OPTIONS "${OPTIONS} --disable-openssl") -endif() - if("ffmpeg" IN_LIST FEATURES) set(OPTIONS "${OPTIONS} --enable-ffmpeg") else() @@ -93,46 +93,6 @@ else() set(OPTIONS "${OPTIONS} --disable-ffprobe") endif() -if("vpx" IN_LIST FEATURES) - set(OPTIONS "${OPTIONS} --enable-libvpx") -else() - set(OPTIONS "${OPTIONS} --disable-libvpx") -endif() - -if("x264" IN_LIST FEATURES) - set(OPTIONS "${OPTIONS} --enable-libx264") -else() - set(OPTIONS "${OPTIONS} --disable-libx264") -endif() - -if("opencl" IN_LIST FEATURES) - set(OPTIONS "${OPTIONS} --enable-opencl") -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() - -set(ENABLE_AVRESAMPLE OFF) -if("avresample" IN_LIST FEATURES) - set(OPTIONS "${OPTIONS} --enable-avresample") - set(ENABLE_AVRESAMPLE ON) #necessary for configuring FFMPEG CMake Module -endif() - if("avcodec" IN_LIST FEATURES) set(OPTIONS "${OPTIONS} --enable-avcodec") set(ENABLE_AVCODEC ON) @@ -165,6 +125,14 @@ else() set(ENABLE_AVFILTER OFF) endif() +if("postproc" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-postproc") + set(ENABLE_POSTPROC ON) +else() + set(OPTIONS "${OPTIONS} --disable-postproc") + set(ENABLE_POSTPROC OFF) +endif() + if("swresample" IN_LIST FEATURES) set(OPTIONS "${OPTIONS} --enable-swresample") set(ENABLE_SWRESAMPLE ON) @@ -181,20 +149,184 @@ else() set(ENABLE_SWSCALE OFF) endif() -if (VCPKG_TARGET_IS_OSX) - set(OPTIONS "${OPTIONS} --disable-vdpau") # disable vdpau in OSX +set(ENABLE_AVRESAMPLE OFF) +if("avresample" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-avresample") + set(ENABLE_AVRESAMPLE ON) +endif() + +if("avisynthplus" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-avisynth") +else() + set(OPTIONS "${OPTIONS} --disable-avisynth") +endif() + +set(STATIC_LINKAGE OFF) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") +set(STATIC_LINKAGE ON) +endif() + +set(ENABLE_BZIP2 OFF) +if("bzip2" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-bzlib") + set(ENABLE_BZIP2 ${STATIC_LINKAGE}) +else() + set(OPTIONS "${OPTIONS} --disable-bzlib") +endif() + +set(ENABLE_ICONV OFF) +if("iconv" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-iconv") + set(ENABLE_ICONV ${STATIC_LINKAGE}) +else() + set(OPTIONS "${OPTIONS} --disable-iconv") +endif() + +set(ENABLE_FDKAAC OFF) +if("fdk-aac" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-libfdk-aac") + set(ENABLE_FDKAAC ${STATIC_LINKAGE}) +else() + set(OPTIONS "${OPTIONS} --disable-libfdk-aac") +endif() + +set(ENABLE_LZMA OFF) +if("lzma" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-lzma") + set(ENABLE_LZMA ${STATIC_LINKAGE}) +else() + set(OPTIONS "${OPTIONS} --disable-lzma") +endif() + +set(ENABLE_LAME OFF) +if("mp3lame" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-libmp3lame") + set(ENABLE_LAME ${STATIC_LINKAGE}) +else() + set(OPTIONS "${OPTIONS} --disable-libmp3lame") endif() if("nvcodec" IN_LIST FEATURES) - set(OPTIONS "${OPTIONS} --enable-cuda --enable-nvenc --enable-cuvid --disable-libnpp") + #Note: the --enable-cuda option does not actually require the cuda sdk or toolset port dependency as ffmpeg uses runtime detection and dynamic loading + set(OPTIONS "${OPTIONS} --enable-cuda --enable-nvenc --enable-nvdec --enable-cuvid") else() - set(OPTIONS "${OPTIONS} --disable-cuda --disable-nvenc --disable-cuvid --disable-libnpp") + set(OPTIONS "${OPTIONS} --disable-cuda --disable-nvenc --disable-nvdec --disable-cuvid") endif() -if("avisynthplus" IN_LIST FEATURES) - set(OPTIONS "${OPTIONS} --enable-avisynth") +set(ENABLE_OPENCL OFF) +if("opencl" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-opencl") + set(ENABLE_OPENCL ${STATIC_LINKAGE}) else() - set(OPTIONS "${OPTIONS} --disable-avisynth") + set(OPTIONS "${OPTIONS} --disable-opencl") +endif() + +set(ENABLE_OPENSSL OFF) +if("openssl" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-openssl") + set(ENABLE_OPENSSL ${STATIC_LINKAGE}) +else() + set(OPTIONS "${OPTIONS} --disable-openssl") +endif() + +set(ENABLE_OPUS OFF) +if("opus" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-libopus") + set(ENABLE_OPUS ${STATIC_LINKAGE}) +else() + set(OPTIONS "${OPTIONS} --disable-libopus") +endif() + +set(ENABLE_SDL2 OFF) +if("sdl2" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-sdl2") + set(ENABLE_SDL2 ${STATIC_LINKAGE}) +else() + set(OPTIONS "${OPTIONS} --disable-sdl2") +endif() + +set(ENABLE_SNAPPY OFF) +if("snappy" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-libsnappy") + set(ENABLE_SNAPPY ${STATIC_LINKAGE}) +else() + set(OPTIONS "${OPTIONS} --disable-libsnappy") +endif() + +set(ENABLE_SOXR OFF) +if("soxr" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-libsoxr") + set(ENABLE_SOXR ${STATIC_LINKAGE}) +else() + set(OPTIONS "${OPTIONS} --disable-libsoxr") +endif() + +set(ENABLE_SPEEX OFF) +if("speex" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-libspeex") + set(ENABLE_SPEEX ${STATIC_LINKAGE}) +else() + set(OPTIONS "${OPTIONS} --disable-libspeex") +endif() + +set(ENABLE_THEORA OFF) +if("theora" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-libtheora") + set(ENABLE_THEORA ${STATIC_LINKAGE}) +else() + set(OPTIONS "${OPTIONS} --disable-libtheora") +endif() + +set(ENABLE_VORBIS OFF) +if("vorbis" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-libvorbis") + set(ENABLE_VORBIS ${STATIC_LINKAGE}) +else() + set(OPTIONS "${OPTIONS} --disable-libvorbis") +endif() + +set(ENABLE_VPX OFF) +if("vpx" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-libvpx") + set(ENABLE_VPX ${STATIC_LINKAGE}) +else() + set(OPTIONS "${OPTIONS} --disable-libvpx") +endif() + +set(ENABLE_WAVPACK OFF) +if("wavpack" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-libwavpack") + set(ENABLE_WAVPACK ${STATIC_LINKAGE}) +else() + set(OPTIONS "${OPTIONS} --disable-libwavpack") +endif() + +set(ENABLE_X264 OFF) +if("x264" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-libx264") + set(ENABLE_X264 ${STATIC_LINKAGE}) +else() + set(OPTIONS "${OPTIONS} --disable-libx264") +endif() + +set(ENABLE_X265 OFF) +if("x265" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-libx265") + set(ENABLE_X265 ${STATIC_LINKAGE}) +else() + set(OPTIONS "${OPTIONS} --disable-libx265") +endif() + +set(ENABLE_ZLIB OFF) +if("zlib" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-zlib") + set(ENABLE_ZLIB ${STATIC_LINKAGE}) +else() + set(OPTIONS "${OPTIONS} --disable-zlib") +endif() + +if (VCPKG_TARGET_IS_OSX) + set(OPTIONS "${OPTIONS} --disable-vdpau") # disable vdpau in OSX endif() set(OPTIONS_CROSS "") @@ -242,8 +374,11 @@ if(VCPKG_TARGET_IS_WINDOWS) endif() endif() +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + set(OPTIONS "${OPTIONS} --pkg-config-flags=--static") +endif() + set(ENV_LIB_PATH "$ENV{${LIB_PATH_VAR}}") -set(ENV{PKG_CONFIG_PATH} "${CURRENT_INSTALLED_DIR}/lib/pkgconfig") message(STATUS "Building Options: ${OPTIONS}") @@ -253,6 +388,7 @@ if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL release) set(ENV{${LIB_PATH_VAR}} "${CURRENT_INSTALLED_DIR}/lib${SEP}${ENV_LIB_PATH}") set(ENV{CFLAGS} "${VCPKG_C_FLAGS} ${VCPKG_C_FLAGS_RELEASE}") set(ENV{LDFLAGS} "${VCPKG_LINKER_FLAGS}") + set(ENV{PKG_CONFIG_PATH} "${CURRENT_INSTALLED_DIR}/lib/pkgconfig") message(STATUS "Building ${_csc_PROJECT_PATH} for Release") file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) vcpkg_execute_required_process( @@ -272,6 +408,7 @@ if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL debug) set(ENV{${LIB_PATH_VAR}} "${CURRENT_INSTALLED_DIR}/debug/lib${SEP}${ENV_LIB_PATH}") set(ENV{CFLAGS} "${VCPKG_C_FLAGS} ${VCPKG_C_FLAGS_DEBUG}") set(ENV{LDFLAGS} "${VCPKG_LINKER_FLAGS}") + set(ENV{PKG_CONFIG_PATH} "${CURRENT_INSTALLED_DIR}/debug/lib/pkgconfig") message(STATUS "Building ${_csc_PROJECT_PATH} for Debug") file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) vcpkg_execute_required_process( |
