diff options
Diffstat (limited to 'linden/indra/cmake')
-rw-r--r-- | linden/indra/cmake/FindNDOF.cmake | 39 | ||||
-rw-r--r-- | linden/indra/cmake/NDOF.cmake | 32 |
2 files changed, 62 insertions, 9 deletions
diff --git a/linden/indra/cmake/FindNDOF.cmake b/linden/indra/cmake/FindNDOF.cmake new file mode 100644 index 0000000..f980e34 --- /dev/null +++ b/linden/indra/cmake/FindNDOF.cmake | |||
@@ -0,0 +1,39 @@ | |||
1 | # -*- cmake -*- | ||
2 | |||
3 | # - Find NDOF | ||
4 | # Find the NDOF includes and library | ||
5 | # This module defines | ||
6 | # NDOF_INCLUDE_DIR, where to find ndofdev_external.h, etc. | ||
7 | # NDOF_LIBRARY, the library needed to use NDOF. | ||
8 | # NDOF_FOUND, If false, do not try to use NDOF. | ||
9 | |||
10 | find_path(NDOF_INCLUDE_DIR ndofdev_external.h | ||
11 | PATH_SUFFIXES ndofdev | ||
12 | ) | ||
13 | |||
14 | set(NDOF_NAMES ${NDOF_NAMES} ndofdev libndofdev) | ||
15 | find_library(NDOF_LIBRARY | ||
16 | NAMES ${NDOF_NAMES} | ||
17 | ) | ||
18 | |||
19 | if (NDOF_LIBRARY AND NDOF_INCLUDE_DIR) | ||
20 | set(NDOF_FOUND "YES") | ||
21 | else (NDOF_LIBRARY AND NDOF_INCLUDE_DIR) | ||
22 | set(NDOF_FOUND "NO") | ||
23 | endif (NDOF_LIBRARY AND NDOF_INCLUDE_DIR) | ||
24 | |||
25 | |||
26 | if (NDOF_FOUND) | ||
27 | if (NOT NDOF_FIND_QUIETLY) | ||
28 | message(STATUS "Found NDOF: Library in '${NDOF_LIBRARY}' and header in '${NDOF_INCLUDE_DIR}' ") | ||
29 | endif (NOT NDOF_FIND_QUIETLY) | ||
30 | else (NDOF_FOUND) | ||
31 | if (NDOF_FIND_REQUIRED) | ||
32 | message(FATAL_ERROR "Could not find NDOF library!") | ||
33 | endif (NDOF_FIND_REQUIRED) | ||
34 | endif (NDOF_FOUND) | ||
35 | |||
36 | mark_as_advanced( | ||
37 | NDOF_LIBRARY | ||
38 | NDOF_INCLUDE_DIR | ||
39 | ) | ||
diff --git a/linden/indra/cmake/NDOF.cmake b/linden/indra/cmake/NDOF.cmake index dad74e9..bdf5db1 100644 --- a/linden/indra/cmake/NDOF.cmake +++ b/linden/indra/cmake/NDOF.cmake | |||
@@ -1,14 +1,28 @@ | |||
1 | # -*- cmake -*- | 1 | # -*- cmake -*- |
2 | include(Prebuilt) | 2 | include(Prebuilt) |
3 | 3 | ||
4 | use_prebuilt_binary(ndofdev) | 4 | if (STANDALONE) |
5 | include(FindNDOF) | ||
6 | if(NOT NDOF_FOUND) | ||
7 | message(STATUS "Building without N-DoF joystick support") | ||
8 | endif(NOT NDOF_FOUND) | ||
9 | else (STANDALONE) | ||
10 | use_prebuilt_binary(ndofdev) | ||
5 | 11 | ||
6 | if (WINDOWS OR DARWIN OR LINUX) | 12 | if (WINDOWS) |
7 | add_definitions(-DLIB_NDOF=1) | 13 | set(NDOF_LIBRARY libndofdev) |
8 | endif (WINDOWS OR DARWIN OR LINUX) | 14 | elseif (DARWIN OR LINUX) |
15 | set(NDOF_LIBRARY ndofdev) | ||
16 | endif (WINDOWS) | ||
17 | |||
18 | set(NDOF_INCLUDE_DIR ${ARCH_PREBUILT_DIRS}/include/ndofdev) | ||
19 | set(NDOF_FOUND 1) | ||
20 | endif (STANDALONE) | ||
9 | 21 | ||
10 | if (WINDOWS) | 22 | if (NDOF_FOUND) |
11 | set(NDOF_LIBRARY libndofdev) | 23 | add_definitions(-DLIB_NDOF=1) |
12 | elseif (DARWIN OR LINUX) | 24 | include_directories(${NDOF_INCLUDE_DIR}) |
13 | set(NDOF_LIBRARY ndofdev) | 25 | else (NDOF_FOUND) |
14 | endif (WINDOWS) | 26 | set(NDOF_INCLUDE_DIR "") |
27 | set(NDOF_LIBRARY "") | ||
28 | endif (NDOF_FOUND) | ||