buildspec.cmake 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. # OBS CMake Windows build dependencies module
  2. include_guard(GLOBAL)
  3. include(buildspec_common)
  4. # _check_dependencies_windows: Set up Windows slice for _check_dependencies
  5. function(_check_dependencies_windows)
  6. set(dependencies_dir "${CMAKE_CURRENT_SOURCE_DIR}/.deps")
  7. set(prebuilt_filename "windows-deps-VERSION-ARCH-REVISION.zip")
  8. set(prebuilt_destination "obs-deps-VERSION-ARCH")
  9. set(qt6_filename "windows-deps-qt6-VERSION-ARCH-REVISION.zip")
  10. set(qt6_destination "obs-deps-qt6-VERSION-ARCH")
  11. set(cef_filename "cef_binary_VERSION_windows_ARCH_REVISION.zip")
  12. set(cef_destination "cef_binary_VERSION_windows_ARCH")
  13. if(CMAKE_VS_PLATFORM_NAME STREQUAL Win32)
  14. set(arch x86)
  15. set(dependencies_list prebuilt)
  16. else()
  17. string(TOLOWER "${CMAKE_VS_PLATFORM_NAME}" arch)
  18. set(dependencies_list prebuilt qt6 cef)
  19. endif()
  20. set(platform windows-${arch})
  21. _check_dependencies()
  22. if(CMAKE_VS_PLATFORM_NAME STREQUAL ARM64 AND NOT QT_HOST_PATH)
  23. file(READ "${CMAKE_CURRENT_SOURCE_DIR}/buildspec.json" buildspec)
  24. string(JSON dependency_data GET ${buildspec} dependencies)
  25. string(JSON data GET ${dependency_data} qt6)
  26. string(JSON version GET ${data} version)
  27. set(qt_x64_dir "${CMAKE_CURRENT_SOURCE_DIR}/.deps/obs-deps-qt6-${version}-x64")
  28. if(IS_DIRECTORY "${qt_x64_dir}")
  29. set(QT_HOST_PATH "${qt_x64_dir}" CACHE STRING "Qt Host Tools Path" FORCE)
  30. else()
  31. message(FATAL_ERROR "Building OBS Studio for Windows ARM64 requires x64 Qt dependencies")
  32. endif()
  33. endif()
  34. endfunction()
  35. _check_dependencies_windows()