summaryrefslogtreecommitdiff
path: root/indra/cmake/FindNDOF.cmake
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2011-01-07 10:39:05 -0500
committerOz Linden <oz@lindenlab.com>2011-01-07 10:39:05 -0500
commite1e38c4cee980f815091cd94c8a529ffe3e24918 (patch)
tree35b16f61bd120f83bb74a77d4417dce1108e0542 /indra/cmake/FindNDOF.cmake
parentc02d6a319f378d5dcc34c51b20f556f175d2a40a (diff)
parent09c01c4e925833873a83665fe0642637b65e547e (diff)
merge changes for storm-34
Diffstat (limited to 'indra/cmake/FindNDOF.cmake')
-rw-r--r--indra/cmake/FindNDOF.cmake39
1 files changed, 39 insertions, 0 deletions
diff --git a/indra/cmake/FindNDOF.cmake b/indra/cmake/FindNDOF.cmake
new file mode 100644
index 0000000000..6dcf590a53
--- /dev/null
+++ b/indra/cmake/FindNDOF.cmake
@@ -0,0 +1,39 @@
+# -*- cmake -*-
+
+# - Find NDOF
+# Find the NDOF includes and library
+# This module defines
+# NDOF_INCLUDE_DIR, where to find ndofdev_external.h, etc.
+# NDOF_LIBRARY, the library needed to use NDOF.
+# NDOF_FOUND, If false, do not try to use NDOF.
+
+find_path(NDOF_INCLUDE_DIR ndofdev_external.h
+ PATH_SUFFIXES ndofdev
+ )
+
+set(NDOF_NAMES ${NDOF_NAMES} ndofdev libndofdev)
+find_library(NDOF_LIBRARY
+ NAMES ${NDOF_NAMES}
+ )
+
+if (NDOF_LIBRARY AND NDOF_INCLUDE_DIR)
+ set(NDOF_FOUND "YES")
+else (NDOF_LIBRARY AND NDOF_INCLUDE_DIR)
+ set(NDOF_FOUND "NO")
+endif (NDOF_LIBRARY AND NDOF_INCLUDE_DIR)
+
+
+if (NDOF_FOUND)
+ if (NOT NDOF_FIND_QUIETLY)
+ message(STATUS "Found NDOF: Library in '${NDOF_LIBRARY}' and header in '${NDOF_INCLUDE_DIR}' ")
+ endif (NOT NDOF_FIND_QUIETLY)
+else (NDOF_FOUND)
+ if (NDOF_FIND_REQUIRED)
+ message(FATAL_ERROR " * * *\nCould not find NDOF library!\nIf you don't need Space Navigator Joystick support you can skip this test by configuring with -DNDOF:BOOL=OFF\n * * *")
+ endif (NDOF_FIND_REQUIRED)
+endif (NDOF_FOUND)
+
+mark_as_advanced(
+ NDOF_LIBRARY
+ NDOF_INCLUDE_DIR
+ )