Xcode: Support "GPU Frame Capture" scheme property
Added XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE
variable which
sets the scheme property value for GPU Frame Capture
in the Options section by setting the Xcode project variable enableGPUFrameCaptureMode
.
Example values are Metal
(1) and Disabled
(3).
XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE
is initialized by the property CMAKE_XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE
.
Issue: #22700 (closed)
Testing
Locally on M1 MacBook Air using Xcode 13.
Set the XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE
variable to "Metal", "Disabled", "0", "1", "2", "3", generated the Xcode project then reviewed the GPU Frame Capture
option in the UI and checked the enableGPUFrameCaptureMode
value in the Xcode project file.
Used this cmake test file to validate the different options in the generated Xcode project
cmake_minimum_required(VERSION 3.22)
set(CMAKE_XCODE_GENERATE_SCHEME ON)
project(EnableGPUFrameCaptureMode)
set(CMAKE_XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE Disabled)
add_executable(GlobalDisabled test.cpp)
set(CMAKE_XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE Metal)
add_executable(GlobalMetal test.cpp)
set(CMAKE_XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE DISABLed)
add_executable(GlobalDisabledCase test.cpp)
set(CMAKE_XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE METAL)
add_executable(GlobalMetalCase test.cpp)
set(CMAKE_XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE 1)
add_executable(GlobalOne test.cpp)
set(CMAKE_XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE 3)
add_executable(GlobalThree test.cpp)
add_executable(TargetDisabled test.cpp)
set_target_properties(TargetDisabled PROPERTIES XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE Disabled)
add_executable(TargetMetal test.cpp)
set_target_properties(TargetMetal PROPERTIES XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE Metal)
add_executable(TargetOne test.cpp)
set_target_properties(TargetOne PROPERTIES XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE 1)
add_executable(TargetThree test.cpp)
set_target_properties(TargetThree PROPERTIES XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE 3)