projects.cmake 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. # OBS CMake 32-bit slice module
  2. include_guard(GLOBAL)
  3. include(compilerconfig)
  4. # legacy_check: Helper macro to automatically include available 32-bit build script
  5. macro(legacy_check)
  6. if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/cmake/32bit-build.cmake")
  7. include(cmake/32bit-build.cmake)
  8. endif()
  9. return()
  10. endmacro()
  11. # target_disable_feature: Stub macro for 32-bit projects
  12. macro(target_disable_feature)
  13. endmacro()
  14. # target_disable: Stub macro for 32-bit projects
  15. macro(target_disable)
  16. endmacro()
  17. # check_uuid: Helper function to check for valid UUID
  18. function(check_uuid uuid_string return_value)
  19. set(valid_uuid TRUE)
  20. # gersemi: off
  21. set(uuid_token_lengths 8 4 4 4 12)
  22. # gersemi: on
  23. set(token_num 0)
  24. string(REPLACE "-" ";" uuid_tokens ${uuid_string})
  25. list(LENGTH uuid_tokens uuid_num_tokens)
  26. if(uuid_num_tokens EQUAL 5)
  27. message(DEBUG "UUID ${uuid_string} is valid with 5 tokens.")
  28. foreach(uuid_token IN LISTS uuid_tokens)
  29. list(GET uuid_token_lengths ${token_num} uuid_target_length)
  30. string(LENGTH "${uuid_token}" uuid_actual_length)
  31. if(uuid_actual_length EQUAL uuid_target_length)
  32. string(REGEX MATCH "[0-9a-fA-F]+" uuid_hex_match ${uuid_token})
  33. if(NOT uuid_hex_match STREQUAL uuid_token)
  34. set(valid_uuid FALSE)
  35. break()
  36. endif()
  37. else()
  38. set(valid_uuid FALSE)
  39. break()
  40. endif()
  41. math(EXPR token_num "${token_num}+1")
  42. endforeach()
  43. else()
  44. set(valid_uuid FALSE)
  45. endif()
  46. message(DEBUG "UUID ${uuid_string} valid: ${valid_uuid}")
  47. set(${return_value} ${valid_uuid} PARENT_SCOPE)
  48. endfunction()
  49. if(OS_WINDOWS)
  50. include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/windows/buildspec.cmake")
  51. add_subdirectory(libobs)
  52. add_subdirectory(plugins/win-capture)
  53. add_subdirectory(plugins/win-dshow)
  54. endif()