2015-08-10 18:19:04 +00:00
|
|
|
# Find Vulkan
|
|
|
|
#
|
|
|
|
# VULKAN_INCLUDE_DIR
|
|
|
|
# VULKAN_LIBRARY
|
|
|
|
# VULKAN_FOUND
|
|
|
|
|
|
|
|
if (WIN32)
|
|
|
|
find_path(VULKAN_INCLUDE_DIR NAMES vulkan/vulkan.h HINTS
|
2016-03-05 22:56:40 +00:00
|
|
|
"$ENV{VULKAN_SDK}/Include"
|
2015-08-10 18:19:04 +00:00
|
|
|
"$ENV{VK_SDK_PATH}/Include")
|
2017-01-04 20:57:41 +00:00
|
|
|
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
2016-02-17 07:26:45 +00:00
|
|
|
find_library(VULKAN_LIBRARY NAMES vulkan-1 HINTS
|
2017-02-27 22:55:52 +00:00
|
|
|
"$ENV{VULKAN_SDK}/Lib"
|
2016-03-05 22:56:40 +00:00
|
|
|
"$ENV{VULKAN_SDK}/Bin"
|
2016-02-17 07:26:45 +00:00
|
|
|
"$ENV{VK_SDK_PATH}/Bin")
|
2016-08-04 22:23:16 +00:00
|
|
|
find_library(VULKAN_STATIC_LIBRARY NAMES vkstatic.1 HINTS
|
2017-02-27 22:55:52 +00:00
|
|
|
"$ENV{VULKAN_SDK}/Lib"
|
2016-08-04 22:23:16 +00:00
|
|
|
"$ENV{VULKAN_SDK}/Bin"
|
|
|
|
"$ENV{VK_SDK_PATH}/Bin")
|
2016-02-17 07:26:45 +00:00
|
|
|
else()
|
|
|
|
find_library(VULKAN_LIBRARY NAMES vulkan-1 HINTS
|
2017-02-27 22:55:52 +00:00
|
|
|
"$ENV{VULKAN_SDK}/Lib32"
|
2016-03-05 22:56:40 +00:00
|
|
|
"$ENV{VULKAN_SDK}/Bin32"
|
2016-02-17 07:26:45 +00:00
|
|
|
"$ENV{VK_SDK_PATH}/Bin32")
|
2017-02-27 22:44:03 +00:00
|
|
|
find_library(VULKAN_STATIC_LIBRARY NAMES vkstatic.1 HINTS
|
2017-02-27 22:55:52 +00:00
|
|
|
"$ENV{VULKAN_SDK}/Lib32"
|
2017-02-27 22:44:03 +00:00
|
|
|
"$ENV{VULKAN_SDK}/Bin32"
|
|
|
|
"$ENV{VK_SDK_PATH}/Bin32")
|
2016-02-17 07:26:45 +00:00
|
|
|
endif()
|
2016-10-13 23:46:56 +00:00
|
|
|
elseif (APPLE)
|
|
|
|
find_library(VULKAN_LIBRARY MoltenVK)
|
|
|
|
if (VULKAN_LIBRARY)
|
|
|
|
set(VULKAN_STATIC_LIBRARY ${VULKAN_LIBRARY})
|
|
|
|
find_path(VULKAN_INCLUDE_DIR NAMES vulkan/vulkan.h HINTS
|
|
|
|
"${VULKAN_LIBRARY}/Headers")
|
|
|
|
endif()
|
2015-08-10 18:19:04 +00:00
|
|
|
else()
|
|
|
|
find_path(VULKAN_INCLUDE_DIR NAMES vulkan/vulkan.h HINTS
|
|
|
|
"$ENV{VULKAN_SDK}/include")
|
|
|
|
find_library(VULKAN_LIBRARY NAMES vulkan HINTS
|
|
|
|
"$ENV{VULKAN_SDK}/lib")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package_handle_standard_args(Vulkan DEFAULT_MSG VULKAN_LIBRARY VULKAN_INCLUDE_DIR)
|
|
|
|
|
2016-08-04 22:23:16 +00:00
|
|
|
mark_as_advanced(VULKAN_INCLUDE_DIR VULKAN_LIBRARY VULKAN_STATIC_LIBRARY)
|
2015-08-10 18:19:04 +00:00
|
|
|
|