aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJuan Ramos <[email protected]>2023-07-05 09:59:18 -0600
committerJuan Ramos <[email protected]>2023-07-05 10:19:57 -0600
commit6f34ca5a370c3664c02abdfc9b11baf7b0c369bd (patch)
tree04d8a108fcc1f6f3af2e98c3e03c85086281b69b
parentad5f8ee9750e99c5397d44c075ae5d8a38271de4 (diff)
downloadVulkan-Headers-6f34ca5a370c3664c02abdfc9b11baf7b0c369bd.tar.gz
Vulkan-Headers-6f34ca5a370c3664c02abdfc9b11baf7b0c369bd.zip
cmake: Remove usage of configure_package_config_file
Fixes issue shown here: https://github.com/KhronosGroup/Vulkan-Headers/pull/415
-rw-r--r--BUILD.md2
-rw-r--r--CMakeLists.txt25
-rw-r--r--cmake/VulkanHeadersConfig.cmake.in5
-rw-r--r--tests/find_package/CMakeLists.txt9
4 files changed, 6 insertions, 35 deletions
diff --git a/BUILD.md b/BUILD.md
index 3dad776..70a635e 100644
--- a/BUILD.md
+++ b/BUILD.md
@@ -36,7 +36,5 @@ find_package(VulkanHeaders REQUIRED CONFIG)
target_link_libraries(foobar PRIVATE Vulkan::Headers)
-message(STATUS "Vulkan Headers Registry: ${VULKAN_HEADERS_REGISTRY_DIRECTORY}")
-
message(STATUS "Vulkan Headers Version: ${VulkanHeaders_VERSION}")
```
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3144c58..d61e75f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -71,27 +71,14 @@ if (VULKAN_HEADERS_INSTALL)
# 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)
- set(cmake_files_install_dir ${CMAKE_INSTALL_DATADIR}/cmake/VulkanHeaders/)
-
set_target_properties(Vulkan-Headers PROPERTIES EXPORT_NAME "Headers")
- install(TARGETS Vulkan-Headers EXPORT VulkanHeadersTargets INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
-
- install(EXPORT VulkanHeadersTargets FILE VulkanHeadersTargets.cmake NAMESPACE "Vulkan::" DESTINATION ${cmake_files_install_dir})
-
- set(vulkan_headers_config "${CMAKE_CURRENT_BINARY_DIR}/VulkanHeadersConfig.cmake")
- set(VULKAN_HEADERS_REGISTRY_DIRECTORY "${VLK_REGISTRY_DIR}/registry")
-
- configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/VulkanHeadersConfig.cmake.in ${vulkan_headers_config}
- INSTALL_DESTINATION ${cmake_files_install_dir}
- PATH_VARS VULKAN_HEADERS_REGISTRY_DIRECTORY
- NO_SET_AND_CHECK_MACRO
- NO_CHECK_REQUIRED_COMPONENTS_MACRO
- )
-
- set(config_version "${CMAKE_CURRENT_BINARY_DIR}/VulkanHeadersConfigVersion.cmake")
+ set(cmake_install_dir "${CMAKE_INSTALL_DATADIR}/cmake/VulkanHeaders")
- write_basic_package_version_file(${config_version} COMPATIBILITY SameMajorVersion ARCH_INDEPENDENT)
+ install(TARGETS Vulkan-Headers EXPORT VulkanHeadersConfig INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+ install(EXPORT VulkanHeadersConfig NAMESPACE "Vulkan::" DESTINATION "${cmake_install_dir}")
- install(FILES ${config_version} ${vulkan_headers_config} DESTINATION ${cmake_files_install_dir})
+ set(version_config "${CMAKE_CURRENT_BINARY_DIR}/generated/VulkanHeadersConfigVersion.cmake")
+ write_basic_package_version_file("${version_config}" COMPATIBILITY SameMajorVersion ARCH_INDEPENDENT)
+ install(FILES "${version_config}" DESTINATION "${cmake_install_dir}")
endif()
diff --git a/cmake/VulkanHeadersConfig.cmake.in b/cmake/VulkanHeadersConfig.cmake.in
deleted file mode 100644
index 2f74a53..0000000
--- a/cmake/VulkanHeadersConfig.cmake.in
+++ /dev/null
@@ -1,5 +0,0 @@
-@PACKAGE_INIT@
-
-include("${CMAKE_CURRENT_LIST_DIR}/VulkanHeadersTargets.cmake")
-
-set(VULKAN_HEADERS_REGISTRY_DIRECTORY "@PACKAGE_VULKAN_HEADERS_REGISTRY_DIRECTORY@")
diff --git a/tests/find_package/CMakeLists.txt b/tests/find_package/CMakeLists.txt
index d9f32a4..f45fc6c 100644
--- a/tests/find_package/CMakeLists.txt
+++ b/tests/find_package/CMakeLists.txt
@@ -8,15 +8,6 @@ if (NOT TARGET Vulkan::Headers)
message(FATAL_ERROR "Vulkan::Headers target not defined")
endif()
-if (NOT DEFINED VULKAN_HEADERS_REGISTRY_DIRECTORY)
- message(FATAL_ERROR "VULKAN_HEADERS_REGISTRY_DIRECTORY not defined!")
-endif()
-
-if (NOT EXISTS "${VULKAN_HEADERS_REGISTRY_DIRECTORY}/vk.xml")
- message(FATAL_ERROR "VULKAN_HEADERS_REGISTRY_DIRECTORY not valid!")
-endif()
-message(STATUS "VULKAN_HEADERS_REGISTRY_DIRECTORY = ${VULKAN_HEADERS_REGISTRY_DIRECTORY}")
-
if (NOT DEFINED VulkanHeaders_VERSION)
message(FATAL_ERROR "VulkanHeaders_VERSION not defined!")
endif()