Skip to content

Commit d3c9457

Browse files
CMake: improved OpenXR SDK handling
* Check if the SDK has already been included * Group targets under DiligentCore/ThirdParty/OpenXR
1 parent 969047c commit d3c9457

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

ThirdParty/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ if (WEBGPU_SUPPORTED)
171171
set_directory_root_folder("dawn" "DiligentCore/ThirdParty/dawn")
172172
endif()
173173

174-
if(DILIGENT_USE_OPENXR)
175-
add_subdirectory(OpenXR-SDK EXCLUDE_FROM_ALL)
174+
if(DILIGENT_USE_OPENXR AND NOT (TARGET openxr_loader))
175+
add_subdirectory(OpenXR-SDK EXCLUDE_FROM_ALL)
176176
endif()
177177

178178
if ((${DILIGENT_BUILD_GOOGLE_TEST}) AND (NOT TARGET gtest))

ThirdParty/OpenXR-SDK/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ FetchContent_Declare(
1111
URL https://github.com/KhronosGroup/OpenXR-SDK-Source/archive/refs/tags/release-1.0.34.zip
1212
)
1313
FetchContent_MakeAvailable(OpenXR)
14+
set_directory_root_folder("${openxr_SOURCE_DIR}" "DiligentCore/ThirdParty/OpenXR")

0 commit comments

Comments
 (0)