diff options
author | Aleric Inglewood <Aleric.Inglewood@gmail.com> | 2010-12-15 22:44:21 +0100 |
---|---|---|
committer | Aleric Inglewood <Aleric.Inglewood@gmail.com> | 2010-12-15 22:44:21 +0100 |
commit | 85446c8cf1da95d0119e0b643144f2959bfa2088 (patch) | |
tree | 052df441bea53cdddd8951b75a285841d8577439 /indra/cmake/NDOF.cmake | |
parent | 5936ced3119b44fab35a6af29339e54feb08e8ff (diff) |
VWR-10579: Fix NDOF.cmake to do the right thing on standalone.
The old one just assumed that libndof is installed,
even on standalone.
This patch looks for it on standalone, unless configured
with -DNDOF:BOOL=OFF, and when not found prints an error
message (including telling about -DNDOF:BOOL=OFF).
Diffstat (limited to 'indra/cmake/NDOF.cmake')
-rw-r--r-- | indra/cmake/NDOF.cmake | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/indra/cmake/NDOF.cmake b/indra/cmake/NDOF.cmake index dad74e99b1..7a463d1190 100644 --- a/indra/cmake/NDOF.cmake +++ b/indra/cmake/NDOF.cmake @@ -1,14 +1,32 @@ # -*- cmake -*- include(Prebuilt) -use_prebuilt_binary(ndofdev) +set(NDOF ON CACHE BOOL "Use NDOF space navigator joystick library.") -if (WINDOWS OR DARWIN OR LINUX) +if (NDOF) + if (STANDALONE) + set(NDOF_FIND_REQUIRED ON) + include(FindNDOF) + else (STANDALONE) + use_prebuilt_binary(ndofdev) + + if (WINDOWS) + set(NDOF_LIBRARY libndofdev) + elseif (DARWIN OR LINUX) + set(NDOF_LIBRARY ndofdev) + endif (WINDOWS) + + set(NDOF_INCLUDE_DIR ${ARCH_PREBUILT_DIRS}/include/ndofdev) + set(NDOF_FOUND 1) + endif (STANDALONE) +endif (NDOF) + +if (NDOF_FOUND) add_definitions(-DLIB_NDOF=1) -endif (WINDOWS OR DARWIN OR LINUX) + include_directories(${NDOF_INCLUDE_DIR}) +else (NDOF_FOUND) + message(STATUS "Building without N-DoF joystick support") + set(NDOF_INCLUDE_DIR "") + set(NDOF_LIBRARY "") +endif (NDOF_FOUND) -if (WINDOWS) - set(NDOF_LIBRARY libndofdev) -elseif (DARWIN OR LINUX) - set(NDOF_LIBRARY ndofdev) -endif (WINDOWS) |