OpenCVDetectDirectX.cmake 776 B

123456789101112131415161718192021222324252627282930
  1. if(WIN32)
  2. try_compile(__VALID_DIRECTX
  3. "${OpenCV_BINARY_DIR}"
  4. "${OpenCV_SOURCE_DIR}/cmake/checks/directx.cpp"
  5. OUTPUT_VARIABLE TRY_OUT
  6. )
  7. if(NOT __VALID_DIRECTX)
  8. return()
  9. endif()
  10. try_compile(__VALID_DIRECTX_NV12
  11. "${OpenCV_BINARY_DIR}"
  12. "${OpenCV_SOURCE_DIR}/cmake/checks/directx.cpp"
  13. COMPILE_DEFINITIONS "-DCHECK_NV12"
  14. OUTPUT_VARIABLE TRY_OUT
  15. )
  16. if(__VALID_DIRECTX_NV12)
  17. set(HAVE_DIRECTX_NV12 ON)
  18. else()
  19. message(STATUS "No support for DirectX NV12 format (install Windows 8 SDK)")
  20. endif()
  21. set(HAVE_DIRECTX ON)
  22. set(HAVE_D3D11 ON)
  23. set(HAVE_D3D10 ON)
  24. set(HAVE_D3D9 ON)
  25. if(HAVE_OPENCL AND WITH_OPENCL_D3D11_NV AND EXISTS "${OPENCL_INCLUDE_DIR}/CL/cl_d3d11_ext.h")
  26. set(HAVE_OPENCL_D3D11_NV ON)
  27. endif()
  28. endif()