enable FindPackage testing for vk module

This commit is contained in:
Jan Kuhlmann 2025-04-02 12:29:43 +02:00 committed by Charles Giessen
parent 41af963e42
commit 1c846fb1a8
3 changed files with 8 additions and 5 deletions

View file

@ -115,7 +115,12 @@ if (VULKAN_HEADERS_ENABLE_INSTALL)
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/registry" DESTINATION "${CMAKE_INSTALL_DATADIR}/vulkan" 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") set_target_properties(Vulkan-Headers PROPERTIES EXPORT_NAME "Headers")
install(TARGETS Vulkan-Headers EXPORT VulkanHeadersConfig INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) if (VULKAN_HEADERS_ENABLE_MODULE)
set_target_properties(Vulkan-HppModule PROPERTIES EXPORT_NAME "HppModule")
install(TARGETS Vulkan-Headers Vulkan-HppModule EXPORT VulkanHeadersConfig INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
else()
install(TARGETS Vulkan-Headers EXPORT VulkanHeadersConfig INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
endif()
install(EXPORT VulkanHeadersConfig NAMESPACE "Vulkan::" DESTINATION "share/cmake/VulkanHeaders") install(EXPORT VulkanHeadersConfig NAMESPACE "Vulkan::" DESTINATION "share/cmake/VulkanHeaders")

View file

@ -26,7 +26,7 @@ add_test(NAME integration.find_package
--build-and-test ${CMAKE_CURRENT_LIST_DIR}/integration --build-and-test ${CMAKE_CURRENT_LIST_DIR}/integration
${CMAKE_CURRENT_BINARY_DIR}/find_package ${CMAKE_CURRENT_BINARY_DIR}/find_package
--build-generator ${CMAKE_GENERATOR} --build-generator ${CMAKE_GENERATOR}
--build-options -DFIND_PACKAGE_TESTING=ON -DCMAKE_PREFIX_PATH=${test_install_dir} --build-options -DFIND_PACKAGE_TESTING=ON -DCMAKE_PREFIX_PATH=${test_install_dir} -DVULKAN_HEADERS_ENABLE_MODULE=${VULKAN_HEADERS_ENABLE_MODULE}
) )
# Installing comes before testing # Installing comes before testing

View file

@ -27,9 +27,7 @@ if (FIND_PACKAGE_TESTING)
message(FATAL_ERROR "VulkanHeaders_VERSION not defined!") message(FATAL_ERROR "VulkanHeaders_VERSION not defined!")
endif() endif()
message(STATUS "VulkanHeaders_VERSION = ${VulkanHeaders_VERSION}") message(STATUS "VulkanHeaders_VERSION = ${VulkanHeaders_VERSION}")
endif() else()
if (NOT FIND_PACKAGE_TESTING)
# Consuming vulkan-headers via add_subdirectory should NOT add installation code to the parent CMake project. # Consuming vulkan-headers via add_subdirectory should NOT add installation code to the parent CMake project.
if (DEFINED CMAKE_INSTALL_INCLUDEDIR) if (DEFINED CMAKE_INSTALL_INCLUDEDIR)
message(FATAL_ERROR "CMAKE_INSTALL_INCLUDEDIR was defined!") message(FATAL_ERROR "CMAKE_INSTALL_INCLUDEDIR was defined!")