如何将 libobs 构建为 obs-studio-node 模块的依赖项?

How to build libobs as dependency of obs-studio-node module?

我正在尝试 obs-studio-node
此模块需要 libobs 作为依赖项。在构建此模块时,如果指定了 none,它会下载 libobs 的预构建版本。我们可以指定自定义 libobs,如 README.md

中所述

我按照这些步骤构建了 libobsREADME.md

中列出了这些步骤
  1. git clone https://github.com/stream-labs/obs-studio
  2. cd obs-studio
  3. git submodule update --init --recursive
  4. mkdir build
  5. cd build
  6. cmake .. -DENABLE_UI=false -DDepsPath="C:\Users\alokm\Downloads\dependencies2019\win64" -DENABLE_SCRIPTING=false -G"Visual Studio 16 2019" -A x64
  7. cmake --build .
  8. cpack -G ZIP

最后一步(cpack -G ZIP)因错误而失败

PS C:\Users\alokm\tmp\streamlabs\obs-studio\build> cpack -G ZIP
CPack: Create package using ZIP
CPack: Install projects
CPack: - Install project: obs-studio []
CMake Error at C:/Users/alokm/tmp/streamlabs/obs-studio/build/deps/w32-pthreads/cmake_install.cmake:51 (file):
  file INSTALL cannot find
  "C:/Users/alokm/tmp/streamlabs/obs-studio/build/deps/w32-pthreads/Release/w32-pthreads.dll":
  File exists.
Call Stack (most recent call first):
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/deps/cmake_install.cmake:37 (include)
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/cmake_install.cmake:37 (include)


CMake Error at C:/Users/alokm/tmp/streamlabs/obs-studio/build/deps/glad/cmake_install.cmake:39 (file):
  file INSTALL cannot find
  "C:/Users/alokm/tmp/streamlabs/obs-studio/build/deps/glad/Release/obsglad.dll":
  File exists.
Call Stack (most recent call first):
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/deps/cmake_install.cmake:42 (include)
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/cmake_install.cmake:37 (include)


CMake Error at C:/Users/alokm/tmp/streamlabs/obs-studio/build/libobs-d3d11/cmake_install.cmake:39 (file):
  file INSTALL cannot find
  "C:/Users/alokm/tmp/streamlabs/obs-studio/build/libobs-d3d11/Release/libobs-d3d11.dll":
  File exists.
Call Stack (most recent call first):
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/cmake_install.cmake:42 (include)


CMake Error at C:/Users/alokm/tmp/streamlabs/obs-studio/build/libobs-winrt/cmake_install.cmake:39 (file):
  file INSTALL cannot find
  "C:/Users/alokm/tmp/streamlabs/obs-studio/build/libobs-winrt/Release/libobs-winrt.dll":
  File exists.
Call Stack (most recent call first):
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/cmake_install.cmake:47 (include)


CMake Error at C:/Users/alokm/tmp/streamlabs/obs-studio/build/libobs-opengl/cmake_install.cmake:39 (file):
  file INSTALL cannot find
  "C:/Users/alokm/tmp/streamlabs/obs-studio/build/libobs-opengl/Release/libobs-opengl.dll":
  File exists.
Call Stack (most recent call first):
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/cmake_install.cmake:52 (include)


CMake Error at C:/Users/alokm/tmp/streamlabs/obs-studio/build/libobs/cmake_install.cmake:51 (file):
  file INSTALL cannot find
  "C:/Users/alokm/tmp/streamlabs/obs-studio/build/libobs/Release/obs.dll":
  File exists.
Call Stack (most recent call first):
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/cmake_install.cmake:57 (include)


CMake Error at C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/coreaudio-encoder/cmake_install.cmake:39 (file):
  file INSTALL cannot find
  "C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/coreaudio-encoder/Release/coreaudio-encoder.dll":
  File exists.
Call Stack (most recent call first):
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/cmake_install.cmake:37 (include)
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/cmake_install.cmake:62 (include)


CMake Error at C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/win-wasapi/cmake_install.cmake:39 (file):
  file INSTALL cannot find
  "C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/win-wasapi/Release/win-wasapi.dll":
  No such file or directory.
Call Stack (most recent call first):
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/cmake_install.cmake:42 (include)
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/cmake_install.cmake:62 (include)


CMake Error at C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/win-dshow/cmake_install.cmake:39 (file):
  file INSTALL cannot find
  "C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/win-dshow/Release/win-dshow.dll":
  No such file or directory.
Call Stack (most recent call first):
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/cmake_install.cmake:47 (include)
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/cmake_install.cmake:62 (include)


CMake Error at C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/win-capture/cmake_install.cmake:39 (file):
  file INSTALL cannot find
  "C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/win-capture/Release/win-capture.dll":
  No such file or directory.
Call Stack (most recent call first):
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/cmake_install.cmake:52 (include)
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/cmake_install.cmake:62 (include)


CMake Error at C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/win-capture/graphics-hook/cmake_install.cmake:39 (file):
  file INSTALL cannot find
  "C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/win-capture/graphics-hook/Release/graphics-hook64.dll":
  No such file or directory.
Call Stack (most recent call first):
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/win-capture/cmake_install.cmake:59 (include)
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/cmake_install.cmake:52 (include)
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/cmake_install.cmake:62 (include)


CMake Error at C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/win-capture/get-graphics-offsets/cmake_install.cmake:39 (file):
  file INSTALL cannot find
  "C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/win-capture/get-graphics-offsets/Release/get-graphics-offsets64.exe":
  No such file or directory.
Call Stack (most recent call first):
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/win-capture/cmake_install.cmake:64 (include)
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/cmake_install.cmake:52 (include)
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/cmake_install.cmake:62 (include)


CMake Error at C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/win-capture/inject-helper/cmake_install.cmake:39 (file):
  file INSTALL cannot find
  "C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/win-capture/inject-helper/Release/inject-helper64.exe":
  No such file or directory.
Call Stack (most recent call first):
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/win-capture/cmake_install.cmake:69 (include)
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/cmake_install.cmake:52 (include)
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/cmake_install.cmake:62 (include)


CMake Error at C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/decklink/win/cmake_install.cmake:39 (file):
  file INSTALL cannot find
  "C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/decklink/win/Release/win-decklink.dll":
  No such file or directory.
Call Stack (most recent call first):
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/cmake_install.cmake:57 (include)
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/cmake_install.cmake:62 (include)


CMake Error at C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/win-mf/cmake_install.cmake:39 (file):
  file INSTALL cannot find
  "C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/win-mf/Release/win-mf.dll":
  No such file or directory.
Call Stack (most recent call first):
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/cmake_install.cmake:62 (include)
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/cmake_install.cmake:62 (include)


CMake Error at C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/obs-qsv11/cmake_install.cmake:39 (file):
  file INSTALL cannot find
  "C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/obs-qsv11/Release/obs-qsv11.dll":
  No such file or directory.
Call Stack (most recent call first):
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/cmake_install.cmake:67 (include)
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/cmake_install.cmake:62 (include)


CMake Error at C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/enc-amf/cmake_install.cmake:39 (file):
  file INSTALL cannot find
  "C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/enc-amf/Release/enc-amf.dll":
  No such file or directory.
Call Stack (most recent call first):
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/cmake_install.cmake:77 (include)
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/cmake_install.cmake:62 (include)


CMake Error at C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/enc-amf/amf-test/cmake_install.cmake:39 (file):
  file INSTALL cannot find
  "C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/enc-amf/amf-test/Release/enc-amf-test64.exe":
  No such file or directory.
Call Stack (most recent call first):
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/enc-amf/cmake_install.cmake:59 (include)
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/cmake_install.cmake:77 (include)
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/cmake_install.cmake:62 (include)


CMake Error at C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/obs-openvr/cmake_install.cmake:39 (file):
  file INSTALL cannot find
  "C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/obs-openvr/Release/win-openvr.dll":
  No such file or directory.
Call Stack (most recent call first):
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/cmake_install.cmake:87 (include)
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/cmake_install.cmake:62 (include)


CMake Error at C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/motion-effect/src/motion-transition/cmake_install.cmake:39 (file):
  file INSTALL cannot find
  "C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/motion-effect/src/motion-transition/Release/motion-transition.dll":
  No such file or directory.
Call Stack (most recent call first):
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/motion-effect/cmake_install.cmake:38 (include)
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/cmake_install.cmake:92 (include)
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/cmake_install.cmake:62 (include)


CMake Error at C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/obs-vst/cmake_install.cmake:39 (file):
  file INSTALL cannot find
  "C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/obs-vst/Release/obs-vst.dll":
  No such file or directory.
Call Stack (most recent call first):
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/cmake_install.cmake:97 (include)
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/cmake_install.cmake:62 (include)


CMake Error at C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/image-source/cmake_install.cmake:39 (file):
  file INSTALL cannot find
  "C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/image-source/Release/image-source.dll":
  No such file or directory.
Call Stack (most recent call first):
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/cmake_install.cmake:102 (include)
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/cmake_install.cmake:62 (include)


CMake Error at C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/obs-x264/cmake_install.cmake:39 (file):
  file INSTALL cannot find
  "C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/obs-x264/Release/obs-x264.dll":
  No such file or directory.
Call Stack (most recent call first):
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/cmake_install.cmake:107 (include)
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/cmake_install.cmake:62 (include)


CMake Error at C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/obs-ffmpeg/cmake_install.cmake:39 (file):
  file INSTALL cannot find
  "C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/obs-ffmpeg/Release/obs-ffmpeg.dll":
  No such file or directory.
Call Stack (most recent call first):
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/cmake_install.cmake:117 (include)
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/cmake_install.cmake:62 (include)


CMake Error at C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/obs-ffmpeg/ffmpeg-mux/cmake_install.cmake:39 (file):
  file INSTALL cannot find
  "C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/obs-ffmpeg/ffmpeg-mux/Release/obs-ffmpeg-mux.exe":
  No such file or directory.
Call Stack (most recent call first):
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/obs-ffmpeg/cmake_install.cmake:59 (include)
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/cmake_install.cmake:117 (include)
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/cmake_install.cmake:62 (include)


CMake Error at C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/obs-outputs/cmake_install.cmake:39 (file):
  file INSTALL cannot find
  "C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/obs-outputs/Release/obs-outputs.dll":
  No such file or directory.
Call Stack (most recent call first):
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/cmake_install.cmake:122 (include)
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/cmake_install.cmake:62 (include)


CMake Error at C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/obs-filters/cmake_install.cmake:39 (file):
  file INSTALL cannot find
  "C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/obs-filters/Release/obs-filters.dll":
  No such file or directory.
Call Stack (most recent call first):
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/cmake_install.cmake:127 (include)
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/cmake_install.cmake:62 (include)


CMake Error at C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/obs-transitions/cmake_install.cmake:39 (file):
  file INSTALL cannot find
  "C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/obs-transitions/Release/obs-transitions.dll":
  No such file or directory.
Call Stack (most recent call first):
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/cmake_install.cmake:132 (include)
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/cmake_install.cmake:62 (include)


CMake Error at C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/obs-text/cmake_install.cmake:39 (file):
  file INSTALL cannot find
  "C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/obs-text/Release/obs-text.dll":
  No such file or directory.
Call Stack (most recent call first):
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/cmake_install.cmake:137 (include)
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/cmake_install.cmake:62 (include)


CMake Error at C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/rtmp-services/cmake_install.cmake:39 (file):
  file INSTALL cannot find
  "C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/rtmp-services/Release/rtmp-services.dll":
  No such file or directory.
Call Stack (most recent call first):
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/cmake_install.cmake:142 (include)
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/cmake_install.cmake:62 (include)


CMake Error at C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/text-freetype2/cmake_install.cmake:39 (file):
  file INSTALL cannot find
  "C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/text-freetype2/Release/text-freetype2.dll":
  No such file or directory.
Call Stack (most recent call first):
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/cmake_install.cmake:147 (include)
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/cmake_install.cmake:62 (include)


CMake Error at C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/obs-ndi/cmake_install.cmake:37 (file):
  file INSTALL cannot find
  "C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/obs-ndi/Release/obs-ndi.dll":
  No such file or directory.
Call Stack (most recent call first):
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/cmake_install.cmake:152 (include)
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/cmake_install.cmake:62 (include)


CMake Error at C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/slobs-virtual-cam/windows/obs-virtual-cam/src/virtual-output/cmake_install.cmake:39 (file):
":
Call Stack (most recent call first):
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/slobs-virtual-cam/cmake_install.cmake:37 (include)
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/cmake_install.cmake:62 (include)


CMake Error at C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/slobs-virtual-cam/windows/obs-virtual-cam/src/virtual-source/cmake_install.cmake:39 (file):
  file INSTALL cannot find
  "C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/slobs-virtual-cam/windows/obs-virtual-cam/src/virtual-source/Release/obs-virtualsource.dll":
  No such file or directory.
Call Stack (most recent call first):
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/slobs-virtual-cam/cmake_install.cmake:37 (include)
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/plugins/cmake_install.cmake:157 (include)
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/cmake_install.cmake:62 (include)


CMake Error at C:/Users/alokm/tmp/streamlabs/obs-studio/build/UI/obs-frontend-api/cmake_install.cmake:39 (file):
  file INSTALL cannot find
  "C:/Users/alokm/tmp/streamlabs/obs-studio/build/UI/obs-frontend-api/Release/obs-frontend-api.dll":
  No such file or directory.
Call Stack (most recent call first):
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/UI/cmake_install.cmake:37 (include)
  C:/Users/alokm/tmp/streamlabs/obs-studio/build/cmake_install.cmake:67 (include)


CPack Error: Error when generating package: OBS Studio (64bit)

我猜 obs-studio 不支持 cpack 所以失败了。
我如何为 obs-studio-node 移动设备构建自定义 libobs

检查您构建的确切配置。 CPack 的输出尝试安装 Release 配置。但是,你没有提到任何项目配置的时间(并且它可能依赖于项目来设置一些默认值)。

尝试明确添加您想要的内容:

$ cmake .. -DENABLE_UI=false -DDepsPath="C:\Users\alokm\Downloads\dependencies2019\win64" -DENABLE_SCRIPTING=false -DCMAKE_CONFIGURATION_TYPES=Release -G "Visual Studio 16 2019" -A x64
$ cmake --build . --config Release