2023-04-22 06:01:15 +08:00
|
|
|
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
|
2018-11-15 07:25:50 +08:00
|
|
|
|
2023-04-22 06:01:15 +08:00
|
|
|
set(vulkan_result_file "${CURRENT_BUILDTREES_DIR}/vulkan-${TARGET_TRIPLET}.cmake.log")
|
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${CMAKE_CURRENT_LIST_DIR}"
|
|
|
|
OPTIONS_RELEASE
|
|
|
|
"-DOUTFILE=${vulkan_result_file}"
|
|
|
|
)
|
2018-11-15 07:25:50 +08:00
|
|
|
|
2023-04-22 06:01:15 +08:00
|
|
|
include("${vulkan_result_file}")
|
|
|
|
if(DETECTED_Vulkan_FOUND)
|
2023-12-29 16:21:45 +08:00
|
|
|
message(STATUS "Found Vulkan ${DETECTED_Vulkan_VERSION} (${DETECTED_Vulkan_LIBRARIES})")
|
2019-02-08 07:20:42 +08:00
|
|
|
else()
|
2023-12-29 16:21:45 +08:00
|
|
|
set(message "Vulkan wasn't found.")
|
|
|
|
if(VCPKG_TARGET_IS_ANDROID AND DETECTED_ANDROID_NATIVE_API_LEVEL AND DETECTED_ANDROID_NATIVE_API_LEVEL LESS "24")
|
|
|
|
string(APPEND message " Vulkan support from the Android NDK requires API level 24 (found: ${DETECTED_ANDROID_NATIVE_API_LEVEL})")
|
2023-04-22 06:01:15 +08:00
|
|
|
endif()
|
|
|
|
message(FATAL_ERROR "${message}")
|
2019-02-08 07:20:42 +08:00
|
|
|
endif()
|
|
|
|
|
2023-12-29 16:21:45 +08:00
|
|
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt"
|
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/vulkan-result.cmake.in"
|
|
|
|
DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}/detect-vulkan"
|
|
|
|
)
|
2023-02-10 02:59:04 +08:00
|
|
|
|
|
|
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
2023-12-29 16:21:45 +08:00
|
|
|
file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" [[
|
|
|
|
This is a stub package. Copyright and license information
|
|
|
|
is provided with Vulkan headers and loader.
|
|
|
|
For Android, the loader is provided by the NDK.
|
|
|
|
]])
|