[2616] | 1 | # Find script for DirectX on Windows |
---|
[2626] | 2 | # Specifically designed to find dxguid and dinput8 for OIS |
---|
[2616] | 3 | # Once loaded this will define |
---|
[2626] | 4 | # DIRECTX_FOUND - system has DirectX |
---|
| 5 | # DIRECTX_INCLUDE_DIR - include directory for DirectX |
---|
| 6 | # DIRECTX_LIBRARIES - libraries for DirectX |
---|
[2616] | 7 | # |
---|
[2626] | 8 | # Set ENV{DXSD_DIR} if that has not been done the SDK installation. |
---|
| 9 | # |
---|
[2616] | 10 | # Several changes and additions by Fabian 'x3n' Landau |
---|
[2626] | 11 | # Simplifications and CMake 2.6.0 bugfix by Reto Grieder |
---|
[2616] | 12 | # > www.orxonox.net < |
---|
| 13 | |
---|
[2583] | 14 | INCLUDE(FindPackageHandleStandardArgs) |
---|
| 15 | INCLUDE(HandleLibraryTypes) |
---|
| 16 | |
---|
[2616] | 17 | FIND_PATH(DIRECTX_INCLUDE_DIR dinput.h |
---|
[2623] | 18 | PATHS $ENV{DXSDK_DIR} |
---|
[2616] | 19 | PATH_SUFFIXES include |
---|
| 20 | ) |
---|
| 21 | FIND_LIBRARY(DIRECTX_LIBRARY_input dinput8 |
---|
[2623] | 22 | PATHS $ENV{DXSDK_DIR} |
---|
[2616] | 23 | PATH_SUFFIXES lib Lib lib/x86 Lib/x86 |
---|
[2623] | 24 | NO_DEFAULT_PATH # Or else CMake 2.6.0 will find the dll in system32 on windows |
---|
[2616] | 25 | ) |
---|
[2623] | 26 | FIND_LIBRARY(DIRECTX_LIBRARY_input dinput8 |
---|
| 27 | PATHS $ENV{DXSDK_DIR} |
---|
| 28 | PATH_SUFFIXES lib Lib lib/x86 Lib/x86 |
---|
| 29 | ) |
---|
[2616] | 30 | FIND_LIBRARY(DIRECTX_LIBRARY_guid dxguid |
---|
[2623] | 31 | PATHS $ENV{DXSDK_DIR} |
---|
[2616] | 32 | PATH_SUFFIXES lib Lib lib/x86 Lib/x86 |
---|
[2623] | 33 | NO_DEFAULT_PATH # Or else CMake 2.6.0 will find the dll in system32 on windows |
---|
[2616] | 34 | ) |
---|
[2623] | 35 | FIND_LIBRARY(DIRECTX_LIBRARY_guid dxguid |
---|
| 36 | PATHS $ENV{DXSDK_DIR} |
---|
| 37 | PATH_SUFFIXES lib Lib lib/x86 Lib/x86 |
---|
| 38 | ) |
---|
[1505] | 39 | |
---|
[2616] | 40 | # Handle the REQUIRED argument and set DIRECTX_FOUND |
---|
| 41 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(DirectX DEFAULT_MSG |
---|
| 42 | DIRECTX_LIBRARY_input |
---|
| 43 | DIRECTX_LIBRARY_guid |
---|
[2628] | 44 | DIRECTX_INCLUDE_DIR |
---|
[2616] | 45 | ) |
---|
[1505] | 46 | |
---|
[2616] | 47 | SET(DIRECTX_LIBRARIES ${DIRECTX_LIBRARY_input} ${DIRECTX_LIBRARY_guid}) |
---|
[1505] | 48 | |
---|
[2579] | 49 | MARK_AS_ADVANCED( |
---|
[2616] | 50 | DIRECTX_INCLUDE_DIR |
---|
| 51 | DIRECTX_LIBRARY_input |
---|
| 52 | DIRECTX_LIBRARY_guid |
---|
[2579] | 53 | ) |
---|