OpenCVDetectVulkan.cmake 556 B

1234567891011121314151617181920
  1. set(VULKAN_INCLUDE_DIRS "${OpenCV_SOURCE_DIR}/3rdparty/include" CACHE PATH "Vulkan include directory")
  2. set(VULKAN_LIBRARIES "")
  3. try_compile(VALID_VULKAN
  4. "${OpenCV_BINARY_DIR}"
  5. "${OpenCV_SOURCE_DIR}/cmake/checks/vulkan.cpp"
  6. CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${VULKAN_INCLUDE_DIRS}"
  7. OUTPUT_VARIABLE TRY_OUT
  8. )
  9. if(NOT ${VALID_VULKAN})
  10. message(WARNING "Can't use Vulkan")
  11. return()
  12. endif()
  13. set(HAVE_VULKAN 1)
  14. if(HAVE_VULKAN)
  15. add_definitions(-DVK_NO_PROTOTYPES)
  16. include_directories(${VULKAN_INCLUDE_DIRS})
  17. endif()