cmake: Revert use of Zeranoe ffmpeg binaries

OBS Studio is a little bit behind with the FFmpeg Binaries, so the Zeranoe binaries will lead to the plugin being unable to load - which is not what we want. Instead just use the OBS Studio dependencies and offer a way to specify an already downloaded directory and also respect FFmpegPath if set.
This commit is contained in:
Michael Fabian 'Xaymar' Dirks
2018-11-25 21:31:45 +01:00
parent 586765555d
commit b0cc52bbc5
+21 -11
View File
@@ -146,6 +146,7 @@ if(NOT TARGET libobs)
endif() endif()
if(NOT ${PropertyPrefix}OBS_NATIVE) if(NOT ${PropertyPrefix}OBS_NATIVE)
set(${PropertyPrefix}OBS_DEPENDENCIES_DIR "" CACHE PATH "Path to OBS Dependencies")
set(CMAKE_PACKAGE_PREFIX "${CMAKE_BINARY_DIR}" CACHE PATH "Path for generated archives.") set(CMAKE_PACKAGE_PREFIX "${CMAKE_BINARY_DIR}" CACHE PATH "Path for generated archives.")
set(CMAKE_PACKAGE_NAME "${PROJECT_NAME}" CACHE STRING "Name for the generated archives.") set(CMAKE_PACKAGE_NAME "${PROJECT_NAME}" CACHE STRING "Name for the generated archives.")
set(CMAKE_PACKAGE_SUFFIX_OVERRIDE "" CACHE STRING "Override for the suffix.") set(CMAKE_PACKAGE_SUFFIX_OVERRIDE "" CACHE STRING "Override for the suffix.")
@@ -206,16 +207,25 @@ else()
return() return()
endif() endif()
# FFmpeg # FFmpeg (compatible with OBS Studio)
download_project( if(NOT ${PropertyPrefix}OBS_NATIVE)
PROJ ffmpeg if(WIN32)
URL "https://ffmpeg.zeranoe.com/builds/win${BITS}/dev/ffmpeg-4.1-win${BITS}-dev.zip" if(NOT IS_DIRECTORY FFmpegPath)
UPDATE_DISCONNECTED 1 if(IS_DIRECTORY "${${PropertyPrefix}OBS_DEPENDENCIES_DIR}")
) set(FFmpegPath "${${PropertyPrefix}OBS_DEPENDENCIES_DIR}/win${BITS}/")
set(FFmpegPath "${ffmpeg_SOURCE_DIR}/") else()
if (WIN32) download_project(
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH:NO") PROJ obsdeps
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH:NO") URL "https://obsproject.com/downloads/dependencies2017.zip"
UPDATE_DISCONNECTED 1
)
set(FFmpegPath "${obsdeps_SOURCE_DIR}/win${BITS}/")
endif()
endif()
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH:NO")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH:NO")
endif()
endif() endif()
find_package(FFmpeg REQUIRED COMPONENTS avutil avcodec swscale) find_package(FFmpeg REQUIRED COMPONENTS avutil avcodec swscale)
@@ -377,7 +387,7 @@ endif()
# CPPCheck # CPPCheck
if(NOT ${PropertyPrefix}OBS_NATIVE) if(NOT ${PropertyPrefix}OBS_NATIVE)
set(excludes ) set(excludes )
list(APPEND excludes "${PROJECT_SOURCE_DIR}/AMF") list(APPEND excludes "${OBS_DEPENDENCIES_DIR}")
if(${PropertyPrefix}OBS_REFERENCE) if(${PropertyPrefix}OBS_REFERENCE)
list(APPEND excludes "${OBS_STUDIO_DIR}/libobs") list(APPEND excludes "${OBS_STUDIO_DIR}/libobs")
elseif(${PropertyPrefix}OBS_PACKAGE) elseif(${PropertyPrefix}OBS_PACKAGE)