cmake: Remove VULKAN_HEADERS_INSTALL
VULKAN_HEADERS_INSTALL was added since it was believed there was a valid use case for it. After looking into the use case that provoked this change there is no reason to keep VULKAN_HEADERS_INSTALL as an option. Here is the use case we do NOT want to support: https://github.com/KhronosGroup/Vulkan-Headers/pull/416#issuecomment-1622318949 Fundamentally this problem is caused add_subdirectory/find_package not being able to work together flawlessly. Which isn't the responsibility of Vulkan-Headers to fix. It's the responsibility of projects that consume Vulkan-Headers to account for either method. As described by the CMake maintainers: https://discourse.cmake.org/t/idiomatic-way-to-handle-packages-and-add-subdirectory/8400
This commit is contained in:
parent
6f34ca5a37
commit
482af6d865
2 changed files with 4 additions and 12 deletions
|
|
@ -57,19 +57,14 @@ if (PROJECT_IS_TOP_LEVEL)
|
|||
if (BUILD_TESTS)
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
option(VULKAN_HEADERS_INSTALL "Install Vulkan Headers" ${PROJECT_IS_TOP_LEVEL})
|
||||
if (VULKAN_HEADERS_INSTALL)
|
||||
include(GNUInstallDirs)
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
set(VLK_REGISTRY_DIR "${CMAKE_INSTALL_DATADIR}/vulkan")
|
||||
|
||||
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/vk_video" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/vulkan" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||
# Preserve source permissions https://github.com/KhronosGroup/Vulkan-Headers/issues/336
|
||||
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/registry" DESTINATION ${VLK_REGISTRY_DIR} USE_SOURCE_PERMISSIONS)
|
||||
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/registry" DESTINATION "${CMAKE_INSTALL_DATADIR}/vulkan" USE_SOURCE_PERMISSIONS)
|
||||
|
||||
set_target_properties(Vulkan-Headers PROPERTIES EXPORT_NAME "Headers")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue