Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/cmake/FindDirectX.cmake @ 1856

Last change on this file since 1856 was 1776, checked in by landauf, 16 years ago

Many changes in almost all FindXYZ.cmake files. They now throw errors if something wasn't found.

  • Property svn:eol-style set to native
File size: 1.4 KB
Line 
1IF(WIN32)
2  # - Test for DirectX
3  # Once loaded this will define
4  #   DirectX_FOUND        - system has DirectX
5  #   DirectX_INCLUDE_DIR  - include directory for DirectX
6  #   DirectX_LIB_DIR      - lib directory for DirectX
7  #
8  # Several changes and additions by Fabian 'x3n' Landau
9  #                 > www.orxonox.net <
10
11  IF (DirectX_INCLUDE_DIR AND DirectX_LIB_DIR)
12    SET(DirectX_FIND_QUIETLY TRUE)
13  ENDIF (DirectX_INCLUDE_DIR AND DirectX_LIB_DIR)
14
15  set(DirectX_FOUND "NO")
16
17  FIND_PATH(DirectX_INCLUDE_DIR "dinput.h"
18    C:/DXSDK/Include
19  )
20
21  FIND_PATH(DirectX_LIB_DIR "dinput8.lib"
22    C:/DXSDK/Lib
23    C:/DXSDK/Lib/x86
24  )
25
26  IF (DirectX_INCLUDE_DIR AND DirectX_LIB_DIR)
27    SET (DirectX_FOUND "YES")
28  ENDIF (DirectX_INCLUDE_DIR AND DirectX_LIB_DIR)
29
30  IF (DirectX_FOUND)
31    IF (NOT DirectX_FIND_QUIETLY)
32      MESSAGE(STATUS "DirectX was found.")
33      IF (VERBOSE_FIND)
34        MESSAGE (STATUS "  include path: ${DirectX_INCLUDE_DIR}")
35        MESSAGE (STATUS "  library path: ${DirectX_LIB_DIR}")
36        MESSAGE (STATUS "  libraries:    dinput8.lib")
37      ENDIF (VERBOSE_FIND)
38    ENDIF (NOT DirectX_FIND_QUIETLY)
39  ELSE (DirectX_FOUND)
40    IF (NOT DirectX_INCLUDE_DIR)
41      MESSAGE(SEND_ERROR "DirectX include path was not found.")
42    ENDIF (NOT DirectX_INCLUDE_DIR)
43    IF (NOT DirectX_LIB_DIR)
44      MESSAGE(SEND_ERROR "DirectX library was not found.")
45    ENDIF (NOT DirectX_LIB_DIR)
46  ENDIF (DirectX_FOUND)
47ENDIF(WIN32)
Note: See TracBrowser for help on using the repository browser.