aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/cmake')
-rw-r--r--linden/indra/cmake/FindNDOF.cmake39
-rw-r--r--linden/indra/cmake/NDOF.cmake32
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
10find_path(NDOF_INCLUDE_DIR ndofdev_external.h
11 PATH_SUFFIXES ndofdev
12 )
13
14set(NDOF_NAMES ${NDOF_NAMES} ndofdev libndofdev)
15find_library(NDOF_LIBRARY
16 NAMES ${NDOF_NAMES}
17 )
18
19if (NDOF_LIBRARY AND NDOF_INCLUDE_DIR)
20 set(NDOF_FOUND "YES")
21else (NDOF_LIBRARY AND NDOF_INCLUDE_DIR)
22 set(NDOF_FOUND "NO")
23endif (NDOF_LIBRARY AND NDOF_INCLUDE_DIR)
24
25
26if (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)
30else (NDOF_FOUND)
31 if (NDOF_FIND_REQUIRED)
32 message(FATAL_ERROR "Could not find NDOF library!")
33 endif (NDOF_FIND_REQUIRED)
34endif (NDOF_FOUND)
35
36mark_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 -*-
2include(Prebuilt) 2include(Prebuilt)
3 3
4use_prebuilt_binary(ndofdev) 4if (STANDALONE)
5 include(FindNDOF)
6 if(NOT NDOF_FOUND)
7 message(STATUS "Building without N-DoF joystick support")
8 endif(NOT NDOF_FOUND)
9else (STANDALONE)
10 use_prebuilt_binary(ndofdev)
5 11
6if (WINDOWS OR DARWIN OR LINUX) 12 if (WINDOWS)
7 add_definitions(-DLIB_NDOF=1) 13 set(NDOF_LIBRARY libndofdev)
8endif (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)
20endif (STANDALONE)
9 21
10if (WINDOWS) 22if (NDOF_FOUND)
11 set(NDOF_LIBRARY libndofdev) 23 add_definitions(-DLIB_NDOF=1)
12elseif (DARWIN OR LINUX) 24 include_directories(${NDOF_INCLUDE_DIR})
13 set(NDOF_LIBRARY ndofdev) 25else (NDOF_FOUND)
14endif (WINDOWS) 26 set(NDOF_INCLUDE_DIR "")
27 set(NDOF_LIBRARY "")
28endif (NDOF_FOUND)