diff options
author | José Fonseca <jfonseca@vmware.com> | 2011-06-02 14:09:33 +0100 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2011-06-02 14:11:34 +0100 |
commit | a316ae51e1125cbae95539ddae5f9c12d87612f5 (patch) | |
tree | 62be3773c75ce6eaf0f6c719b34ef5790ee7716c | |
parent | 920bffd8441869006382225fd4e268513f1761a2 (diff) |
Smarter detection of DirectX SDK.
-rw-r--r-- | cmake/FindDirectX.cmake | 83 |
1 files changed, 46 insertions, 37 deletions
diff --git a/cmake/FindDirectX.cmake b/cmake/FindDirectX.cmake index 4b4824c2..352e1a3e 100644 --- a/cmake/FindDirectX.cmake +++ b/cmake/FindDirectX.cmake @@ -1,60 +1,77 @@ # - try to find DirectX include dirs and libraries if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") - find_path (DirectX_DDRAW_INCLUDE_DIR ddraw.h - PATHS - "$ENV{DXSDK_DIR}/Include" - "$ENV{ProgramFiles}/Microsoft DirectX SDK/Include" + find_path (DirectX_ROOT_DIR + Include/d3d9.h + PATHS + "$ENV{DXSDK_DIR}" + "$ENV{ProgramFiles}/Microsoft DirectX SDK (June 2010)" + "$ENV{ProgramFiles}/Microsoft DirectX SDK (February 2010)" + "$ENV{ProgramFiles}/Microsoft DirectX SDK (March 2009)" + "$ENV{ProgramFiles}/Microsoft DirectX SDK (August 2008)" + "$ENV{ProgramFiles}/Microsoft DirectX SDK (June 2008)" + "$ENV{ProgramFiles}/Microsoft DirectX SDK (March 2008)" + "$ENV{ProgramFiles}/Microsoft DirectX SDK (November 2007)" + "$ENV{ProgramFiles}/Microsoft DirectX SDK (August 2007)" + "$ENV{ProgramFiles}/Microsoft DirectX SDK" + "$ENV{ProgramFiles(x86)}/Microsoft DirectX SDK (June 2010)" + "$ENV{ProgramFiles(x86)}/Microsoft DirectX SDK (February 2010)" + "$ENV{ProgramFiles(x86)}/Microsoft DirectX SDK (March 2009)" + "$ENV{ProgramFiles(x86)}/Microsoft DirectX SDK (August 2008)" + "$ENV{ProgramFiles(x86)}/Microsoft DirectX SDK (June 2008)" + "$ENV{ProgramFiles(x86)}/Microsoft DirectX SDK (March 2008)" + "$ENV{ProgramFiles(x86)}/Microsoft DirectX SDK (November 2007)" + "$ENV{ProgramFiles(x86)}/Microsoft DirectX SDK (August 2007)" + "$ENV{ProgramFiles(x86)}/Microsoft DirectX SDK" + DOC "DirectX SDK root directory") + + + find_path (DirectX_D3D_INCLUDE_DIR d3d.h + PATHS + "${DirectX_ROOT_DIR}/Include" DOC "The directory where d3d.h resides") find_path (DirectX_D3DX_INCLUDE_DIR d3dx.h PATHS - "$ENV{DXSDK_DIR}/Include" - "$ENV{ProgramFiles}/Microsoft DirectX SDK/Include" + "${DirectX_ROOT_DIR}/Include" DOC "The directory where d3dx.h resides") - find_library (DirectX_DDRAW_LIBRARY ddraw + find_library (DirectX_DDRAW_LIBRARY ddraw PATHS - "$ENV{DXSDK_DIR}/Lib/x86" - "$ENV{ProgramFiles}/Microsoft DirectX SDK/Lib/x86" + "${DirectX_ROOT_DIR}/Lib/x86" DOC "The directory where ddraw resides") find_library (DirectX_D3DX_LIBRARY d3dx PATHS - "$ENV{DXSDK_DIR}/Lib/x86" - "$ENV{ProgramFiles}/Microsoft DirectX SDK/Lib/x86" + "${DirectX_ROOT_DIR}/Lib/x86" DOC "The directory where d3dx resides") - if (DirectX_D3D_INCLUDE_DIR AND DirectX_D3D_LIBRARY) + if (DirectX_D3D_INCLUDE_DIR AND DirectX_DDRAW_LIBRARY) set (DirectX_D3D_FOUND 1) if (DirectX_D3DX_INCLUDE_DIR AND DirectX_D3DX_LIBRARY) set (DirectX_D3DX_FOUND 1) endif (DirectX_D3DX_INCLUDE_DIR AND DirectX_D3DX_LIBRARY) - endif (DirectX_D3D_INCLUDE_DIR AND DirectX_D3D_LIBRARY) + endif (DirectX_D3D_INCLUDE_DIR AND DirectX_DDRAW_LIBRARY) find_path (DirectX_D3D8_INCLUDE_DIR d3d8.h PATHS - "$ENV{DXSDK_DIR}/Include" - "$ENV{ProgramFiles}/Microsoft DirectX SDK/Include" + "${DirectX_ROOT_DIR}/Include" DOC "The directory where d3d8.h resides") find_path (DirectX_D3DX8_INCLUDE_DIR d3dx8.h PATHS - "$ENV{DXSDK_DIR}/Include" - "$ENV{ProgramFiles}/Microsoft DirectX SDK/Include" + "${DirectX_ROOT_DIR}/Include" DOC "The directory where d3dx8.h resides") find_library (DirectX_D3D8_LIBRARY d3d8 PATHS - "$ENV{DXSDK_DIR}/Lib/x86" - "$ENV{ProgramFiles}/Microsoft DirectX SDK/Lib/x86" + "${DirectX_ROOT_DIR}/Lib/x86" DOC "The directory where d3d8 resides") find_library (DirectX_D3DX8_LIBRARY d3dx8 PATHS - "$ENV{DXSDK_DIR}/Lib/x86" - "$ENV{ProgramFiles}/Microsoft DirectX SDK/Lib/x86" + "${DirectX_ROOT_DIR}/Lib/x86" DOC "The directory where d3dx8 resides") if (DirectX_D3D8_INCLUDE_DIR AND DirectX_D3D8_LIBRARY) @@ -67,26 +84,22 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") find_path (DirectX_D3D9_INCLUDE_DIR d3d9.h PATHS - "$ENV{DXSDK_DIR}/Include" - "$ENV{ProgramFiles}/Microsoft DirectX SDK/Include" + "${DirectX_ROOT_DIR}/Include" DOC "The directory where d3d9.h resides") find_path (DirectX_D3DX9_INCLUDE_DIR d3dx9.h PATHS - "$ENV{DXSDK_DIR}/Include" - "$ENV{ProgramFiles}/Microsoft DirectX SDK/Include" + "${DirectX_ROOT_DIR}/Include" DOC "The directory where d3dx9.h resides") find_library (DirectX_D3D9_LIBRARY d3d9 PATHS - "$ENV{DXSDK_DIR}/Lib/x86" - "$ENV{ProgramFiles}/Microsoft DirectX SDK/Lib/x86" + "${DirectX_ROOT_DIR}/Lib/x86" DOC "The directory where d3d9 resides") find_library (DirectX_D3DX9_LIBRARY d3dx9 PATHS - "$ENV{DXSDK_DIR}/Lib/x86" - "$ENV{ProgramFiles}/Microsoft DirectX SDK/Lib/x86" + "${DirectX_ROOT_DIR}/Lib/x86" DOC "The directory where d3dx9 resides") if (DirectX_D3D9_INCLUDE_DIR AND DirectX_D3D9_LIBRARY) @@ -99,26 +112,22 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") find_path (DirectX_D3D10_INCLUDE_DIR d3d10.h PATHS - "$ENV{DXSDK_DIR}/Include" - "$ENV{ProgramFiles}/Microsoft DirectX SDK/Include" + "${DirectX_ROOT_DIR}/Include" DOC "The directory where d3d10.h resides") find_path (DirectX_D3DX10_INCLUDE_DIR d3dx10.h PATHS - "$ENV{DXSDK_DIR}/Include" - "$ENV{ProgramFiles}/Microsoft DirectX SDK/Include" + "${DirectX_ROOT_DIR}/Include" DOC "The directory where d3dx10.h resides") find_library (DirectX_D3D10_LIBRARY d3d10 PATHS - "$ENV{DXSDK_DIR}/Lib/x86" - "$ENV{ProgramFiles}/Microsoft DirectX SDK/Lib/x86" + "${DirectX_ROOT_DIR}/Lib/x86" DOC "The directory where d3d10 resides") find_library (DirectX_D3DX10_LIBRARY d3dx10 PATHS - "$ENV{DXSDK_DIR}/Lib/x86" - "$ENV{ProgramFiles}/Microsoft DirectX SDK/Lib/x86" + "${DirectX_ROOT_DIR}/Lib/x86" DOC "The directory where d3dx10 resides") if (DirectX_D3D10_INCLUDE_DIR AND DirectX_D3D10_LIBRARY) |