Skip to content

Commit

Permalink
cmake: Use share instead of DATADIR for CMake config files
Browse files Browse the repository at this point in the history
See the following discussion for context:
https://discourse.cmake.org/t/what-should-the-destination-be-for-a-header-only-librarys-cmake-config-file/8473/3

TLDR: `DATADIR` can be `share` but it doesn't have to be. It can
be changed by the user.
  • Loading branch information
juan-lunarg committed Jul 10, 2023
1 parent 485c039 commit 2565ffa
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,10 @@ if (PROJECT_IS_TOP_LEVEL)

set_target_properties(Vulkan-Headers PROPERTIES EXPORT_NAME "Headers")

set(cmake_install_dir "${CMAKE_INSTALL_DATADIR}/cmake/VulkanHeaders")

install(TARGETS Vulkan-Headers EXPORT VulkanHeadersConfig INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(EXPORT VulkanHeadersConfig NAMESPACE "Vulkan::" DESTINATION "${cmake_install_dir}")
install(EXPORT VulkanHeadersConfig NAMESPACE "Vulkan::" DESTINATION "share/cmake/VulkanHeaders")

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}")
install(FILES "${version_config}" DESTINATION "share/cmake/VulkanHeaders")
endif()

0 comments on commit 2565ffa

Please sign in to comment.