1if(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  set(HAVE_DIRECTX ON)
11  set(HAVE_D3D11 ON)
12  set(HAVE_D3D10 ON)
13  set(HAVE_D3D9 ON)
14endif()
15