Skip to content

Commit

Permalink
cmake: Add find_package support
Browse files Browse the repository at this point in the history
  • Loading branch information
juan-lunarg committed Sep 13, 2023
1 parent 21b2a9d commit d40385b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions loader/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,13 @@ if(PKG_CONFIG_FOUND)
endif()

target_link_libraries(vulkan PRIVATE Vulkan::Headers)
add_library(Vulkan::Vulkan ALIAS vulkan)
add_library(Vulkan::Loader ALIAS vulkan)

install(TARGETS vulkan)
if (APPLE AND BUILD_STATIC_LOADER)
# When exporting a static library all linked libraries - private or not - need to be exported.
return()
endif()

install(TARGETS vulkan EXPORT VulkanLoaderConfig)
set_target_properties(vulkan PROPERTIES EXPORT_NAME "Loader")
install(EXPORT VulkanLoaderConfig DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/VulkanLoader NAMESPACE Vulkan::)

0 comments on commit d40385b

Please sign in to comment.