2015-08-10 14:19:04 -04: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 17:56:40 -05:00
|
|
|
"$ENV{VULKAN_SDK}/Include"
|
2015-08-10 14:19:04 -04:00
|
|
|
"$ENV{VK_SDK_PATH}/Include")
|
2017-01-04 15:57:41 -05:00
|
|
|
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
2016-02-17 02:26:45 -05:00
|
|
|
find_library(VULKAN_LIBRARY NAMES vulkan-1 HINTS
|
2016-03-05 17:56:40 -05:00
|
|
|
"$ENV{VULKAN_SDK}/Bin"
|
2016-02-17 02:26:45 -05:00
|
|
|
"$ENV{VK_SDK_PATH}/Bin")
|
2016-08-04 18:23:16 -04:00
|
|
|
find_library(VULKAN_STATIC_LIBRARY NAMES vkstatic.1 HINTS
|
|
|
|
"$ENV{VULKAN_SDK}/Bin"
|
|
|
|
"$ENV{VK_SDK_PATH}/Bin")
|
2016-02-17 02:26:45 -05:00
|
|
|
else()
|
|
|
|
find_library(VULKAN_LIBRARY NAMES vulkan-1 HINTS
|
2016-03-05 17:56:40 -05:00
|
|
|
"$ENV{VULKAN_SDK}/Bin32"
|
2016-02-17 02:26:45 -05:00
|
|
|
"$ENV{VK_SDK_PATH}/Bin32")
|
|
|
|
endif()
|
2016-10-13 19:46:56 -04: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 14:19:04 -04: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 18:23:16 -04:00
|
|
|
mark_as_advanced(VULKAN_INCLUDE_DIR VULKAN_LIBRARY VULKAN_STATIC_LIBRARY)
|
2015-08-10 14:19:04 -04:00
|
|
|
|