瀏覽代碼

cmake: Allow external plugins to share libobs deps

This addition allows external cmake modules to include the same modules
that are commonly distributed with the main obs-studio repo: things like
FFmpeg, curl, etc.
jp9000 10 年之前
父節點
當前提交
4ed1e2f03c
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      cmake/external/FindLibobs.cmake

+ 6 - 0
cmake/external/FindLibobs.cmake

@@ -96,6 +96,12 @@ if(LIBOBS_FOUND)
 	set(LIBOBS_INCLUDE_DIRS ${LIBOBS_INCLUDE_DIR} ${W32_PTHREADS_INCLUDE_DIR})
 	set(LIBOBS_LIBRARIES ${LIBOBS_LIB} ${W32_PTHREADS_LIB})
 	include(${LIBOBS_INCLUDE_DIR}/../cmake/external/ObsPluginHelpers.cmake)
+
+	# allows external plugins to easily use/share common dependencies that are often included with libobs (such as FFmpeg)
+	if(NOT DEFINED INCLUDED_LIBOBS_CMAKE_MODULES)
+		set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${LIBOBS_INCLUDE_DIR}/../cmake/Modules/")
+		set(INCLUDED_LIBOBS_CMAKE_MODULES true)
+	endif()
 else()
 	message(FATAL_ERROR "Could not find the libobs library" )
 endif()