summaryrefslogtreecommitdiff
path: root/indra/cmake/DirectX.cmake
blob: 1741dc111f732d878c248953f0fcb79b1ecf7a05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# -*- cmake -*-

if (WINDOWS)
  if(ADDRESS_SIZE EQUAL 32)
    set(PROGRAMFILES_x86 $ENV{PROGRAMFILES})
  else(ADDRESS_SIZE EQUAL 32)
    set(PROGRAMFILES_x86 $ENV{PROGRAMFILES\(X86\)})
  endif(ADDRESS_SIZE EQUAL 32)

  find_path(DIRECTX_INCLUDE_DIR dxdiag.h
            "$ENV{DXSDK_DIR}/Include"
            "${PROGRAMFILES_x86}/Windows Kits/8.1/Include/um"
            "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (June 2010)/Include"
            "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (August 2009)/Include"
            "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (March 2009)/Include"
            "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (August 2008)/Include"
            "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (June 2008)/Include"
            "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (March 2008)/Include"
            "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (November 2007)/Include"
            "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (August 2007)/Include"
            "C:/DX90SDK/Include"
            "$ENV{PROGRAMFILES}/DX90SDK/Include"
            )
  if (DIRECTX_INCLUDE_DIR)
    include_directories(${DIRECTX_INCLUDE_DIR})
    if (DIRECTX_FIND_QUIETLY)
      message(STATUS "Found DirectX include: ${DIRECTX_INCLUDE_DIR}")
    endif (DIRECTX_FIND_QUIETLY)
  else (DIRECTX_INCLUDE_DIR)
    message(FATAL_ERROR "Could not find DirectX SDK Include")
  endif (DIRECTX_INCLUDE_DIR)


  find_path(DIRECTX_LIBRARY_DIR dxguid.lib
            "$ENV{DXSDK_DIR}/Lib/x86"
            "${PROGRAMFILES_x86}/Windows Kits/8.1/Lib/winv6.3/um/x86"
            "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (June 2010)/Lib/x86"
            "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (August 2009)/Lib/x86"
            "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (March 2009)/Lib/x86"
            "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (August 2008)/Lib/x86"
            "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (June 2008)/Lib/x86"
            "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (March 2008)/Lib/x86"
            "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (November 2007)/Lib/x86"
            "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (August 2007)/Lib/x86"
            "C:/DX90SDK/Lib"
            "$ENV{PROGRAMFILES}/DX90SDK/Lib"
            )
  if (DIRECTX_LIBRARY_DIR)
    if (DIRECTX_FIND_QUIETLY)
      message(STATUS "Found DirectX include: ${DIRECTX_LIBRARY_DIR}")
    endif (DIRECTX_FIND_QUIETLY)
  else (DIRECTX_LIBRARY_DIR)
    message(FATAL_ERROR "Could not find DirectX SDK Libraries")
  endif (DIRECTX_LIBRARY_DIR)

endif (WINDOWS)