From 5a6c2baadbc16fc2099a6951e389b9bd3cad08f6 Mon Sep 17 00:00:00 2001 From: lujinwangnv <143145775+lujinwangnv@users.noreply.github.com> Date: Fri, 9 May 2025 18:01:22 -0700 Subject: Update build to allow setting more external paths (#7044) * Update build to allow setting more external paths Update the build to allow setting user-specific paths for the external modules: glm, imgui, slang-rhi, and tinyobjloader. --- external/CMakeLists.txt | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'external') diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index afab86a9d..55d9e4941 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -157,11 +157,19 @@ endif() # imgui add_library(imgui INTERFACE) -target_include_directories( - imgui - ${system} - INTERFACE "${CMAKE_CURRENT_LIST_DIR}/imgui" -) +if(NOT SLANG_OVERRIDE_IMGUI_PATH) + target_include_directories( + imgui + ${system} + INTERFACE "${CMAKE_CURRENT_LIST_DIR}/imgui" + ) +else() + target_include_directories( + imgui + ${system} + INTERFACE "${SLANG_OVERRIDE_IMGUI_PATH}" + ) +endif() # stb add_library(stb INTERFACE) @@ -196,7 +204,16 @@ if(SLANG_ENABLE_SLANG_RHI) set(SLANG_RHI_ENABLE_D3D11 OFF) set(SLANG_RHI_ENABLE_D3D12 OFF) endif() - add_subdirectory(slang-rhi) + if(NOT SLANG_OVERRIDE_SLANG_RHI_PATH) + add_subdirectory(slang-rhi) + else() + add_subdirectory( + ${SLANG_OVERRIDE_SLANG_RHI_PATH} + slang-rhi + EXCLUDE_FROM_ALL + ${system} + ) + endif() endif() # Tidy things up: -- cgit v1.2.3