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)
|
2017-07-10 15:07:59 +00:00
|
|
|
set(CMAKE_FIND_FRAMEWORK NEVER)
|
2016-10-13 23:46:56 +00:00
|
|
|
find_library(VULKAN_LIBRARY MoltenVK)
|
2017-07-10 15:07:59 +00:00
|
|
|
set(CMAKE_FIND_FRAMEWORK ONLY)
|
|
|
|
find_library(VULKAN_STATIC_LIBRARY MoltenVK)
|
|
|
|
find_path(VULKAN_INCLUDE_DIR NAMES vulkan/vulkan.h HINTS
|
|
|
|
"${VULKAN_LIBRARY}/Headers")
|
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
|
|
|
|