优化cmake

This commit is contained in:
2026-08-13 23:10:04 +08:00
parent 432c3afe6c
commit aea74a219b
61 changed files with 12001 additions and 44 deletions
+21 -1
View File
@@ -194,19 +194,39 @@ block()
)
rcl_get_effective_install_dir(render_3D::Vulkan-Hpp VULKAN_HPP_ROOT)
rcl_cmake_library_set_cmake_options(render_3D::Vulkan-Hpp ${Vulkan-Hpp_option})
find_package(Vulkan REQUIRED)
get_filename_component(VULKAN_SDK_ROOT "${Vulkan_INCLUDE_DIR}" DIRECTORY)
set(volk_option ${base_options})
list(APPEND volk_option
-DVOLK_INSTALL=ON
-DVOLK_PULL_IN_VULKAN=ON
-DVOLK_HEADERS_ONLY=OFF
-DVOLK_NAMESPACE=ON
-DVOLK_NAMESPACE=OFF
"-DVULKAN_HEADERS_INSTALL_DIR=${VULKAN_SDK_ROOT}"
)
if (WIN32)
list(APPEND volk_option
-DVOLK_STATIC_DEFINES=VK_USE_PLATFORM_WIN32_KHR
)
endif ()
_register_git_cmake_library(render_3D::volk
"https://github.com/zeux/volk.git"
"vulkan-sdk-1.4.357.0"
)
rcl_get_effective_install_dir(render_3D::volk VOLK_ROOT)
set(VOLK_CONFIG_DIR "${VOLK_ROOT}/lib/cmake/volk")
rcl_cmake_library_set_cmake_options(render_3D::volk ${volk_option})
rcl_cmake_library_set_other_use_opt(render_3D::volk
"-Dvolk_DIR=\"${VOLK_CONFIG_DIR}\""
)
rcl_cmake_library_set_init_script(render_3D::volk
"set(VOLK_ROOT \"${VOLK_ROOT}\")"
"set(volk_DIR \"${VOLK_CONFIG_DIR}\")"
)
rcl_cmake_library_set_clear_script(render_3D::volk
"unset(VOLK_ROOT)"
"unset(volk_DIR)"
)
set(VulkanMemoryAllocator_option ${base_options})
_register_git_cmake_library(render_3D::VulkanMemoryAllocator
"https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git"