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
|
2017-02-27 17:55:52 -05:00
|
|
|
"$ENV{VULKAN_SDK}/Lib"
|
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
|
2017-02-27 17:55:52 -05:00
|
|
|
"$ENV{VULKAN_SDK}/Lib"
|
2016-08-04 18:23:16 -04:00
|
|
|
"$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
|
2017-02-27 17:55:52 -05:00
|
|
|
"$ENV{VULKAN_SDK}/Lib32"
|
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")
|
2017-02-27 17:44:03 -05:00
|
|
|
find_library(VULKAN_STATIC_LIBRARY NAMES vkstatic.1 HINTS
|
2017-02-27 17:55:52 -05:00
|
|
|
"$ENV{VULKAN_SDK}/Lib32"
|
2017-02-27 17:44:03 -05:00
|
|
|
"$ENV{VULKAN_SDK}/Bin32"
|
|
|
|
"$ENV{VK_SDK_PATH}/Bin32")
|
2016-02-17 02:26:45 -05:00
|
|
|
endif()
|
2016-10-13 19:46:56 -04:00
|
|
|
elseif (APPLE)
|
2017-07-10 11:07:59 -04:00
|
|
|
set(CMAKE_FIND_FRAMEWORK NEVER)
|
2016-10-13 19:46:56 -04:00
|
|
|
find_library(VULKAN_LIBRARY MoltenVK)
|
2017-07-10 11:07:59 -04: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 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
|
|
|
|