Unreviewed, rolling out r188919.
[WebKit-https.git] / Source / cmake / FindDirectX.cmake
1 # - Find DirectX SDK installation\r
2 # Find the DirectX includes and library\r
3 # This module defines\r
4 #  DirectX_INCLUDE_DIRS, where to find d3d9.h, etc.\r
5 #  DirectX_LIBRARIES, libraries to link against to use DirectX.\r
6 #  DirectX_FOUND, If false, do not try to use DirectX.\r
7 #  DirectX_ROOT_DIR, directory where DirectX was installed.\r
8 \r
9 find_path(DirectX_INCLUDE_DIRS d3d9.h PATHS\r
10     "$ENV{DXSDK_DIR}/Include"\r
11     "$ENV{PROGRAMFILES}/Microsoft DirectX SDK*/Include"\r
12 )\r
13 \r
14 get_filename_component(DirectX_ROOT_DIR "${DirectX_INCLUDE_DIRS}/.." ABSOLUTE)\r
15 \r
16 if (CMAKE_CL_64)\r
17     set(DirectX_LIBRARY_PATHS "${DirectX_ROOT_DIR}/Lib/x64")\r
18 else ()\r
19     set(DirectX_LIBRARY_PATHS "${DirectX_ROOT_DIR}/Lib/x86" "${DirectX_ROOT_DIR}/Lib")\r
20 endif ()\r
21 \r
22 find_library(DirectX_D3D9_LIBRARY d3d9 ${DirectX_LIBRARY_PATHS} NO_DEFAULT_PATH)\r
23 find_library(DirectX_D3DX9_LIBRARY d3dx9 ${DirectX_LIBRARY_PATHS} NO_DEFAULT_PATH)\r
24 set(DirectX_LIBRARIES ${DirectX_D3D9_LIBRARY} ${DirectX_D3DX9_LIBRARY})\r
25 \r
26 # handle the QUIETLY and REQUIRED arguments and set DirectX_FOUND to TRUE if all listed variables are TRUE\r
27 include(FindPackageHandleStandardArgs)\r
28 FIND_PACKAGE_HANDLE_STANDARD_ARGS(DirectX DEFAULT_MSG DirectX_ROOT_DIR DirectX_LIBRARIES DirectX_INCLUDE_DIRS)\r
29 mark_as_advanced(DirectX_INCLUDE_DIRS DirectX_D3D9_LIBRARY DirectX_D3DX9_LIBRARY)\r