VWR-10579: Fix NDOF.cmake to do the right thing on standalone.
Review Request #45 - Created Dec. 19, 2010 and submitted
Aleric Inglewood | Reviewers | ||
viewer | |||
VWR-10579 | |||
None | viewer-development |
On standalone, only define -DLIB_NDOF=1 when NDOF can be found.
I can't remember when I started using this, but it was long ago. I don't have libndofdev installed. I just installed Michelle's debian package libndofdev-dev and then it found it: -- Found NDOF: Library in '/usr/lib/libndofdev.so' and header in '/usr/include'
Posted (Dec. 19, 2010, 12:34 p.m.)
I'd prefer the following behavior: Let the user specify whether to use libndofdev or not. (Of course we'd have to agree on a default if nothing was specified). Then ... ... if libndofdev use has been enabled and libndofdev can be found, --> build with libndofdev support, thus with the joystick/spacenavigator features. ... if libndofdev use has been enabled but libndofdev can not be found, --> error out. (With some meaningful message) ... if libndofdev use has been disabled, --> don't build with libndofdev support, even if libndofdev is present. Rationale: If I *want* spacenavigator or joystick support, but libndofdev cannot be found (e.g. because I forgot to install it or because it was installed to a location that isn't searched), I'll get a heads-up at build time rather than having to figure out why stuff doesn't behave the way I want at runtime. Note: This would be analogous to how we currently handle FMOD, even although disabling FMOD -- other than disabling libndofdev -- doesn't result in unavailable viewer features.
Review request changed
Updated (Dec. 20, 2010, 6:04 a.m.)
-
- added Diff r2
-
Only define -DLIB_NDOF=1 when NDOF is actually found, on standalone. While FindNDOF.cmake was added to the repository, it wasn't used.
On standalone, only define -DLIB_NDOF=1 when NDOF can be found.
This new patch addresses Boroondas -heh- preferences ;) it tries to find NDOF and when not found prints an error and the instructions to configure with -DNDOF:BOOL=OFF if you really don't want space navigator joystick support. This is indeed very simular to how FMOD works currently. This new patch also adds indra/cmake/FindNDOF.cmake, which was erroneously missing from the first patch, oops!
Other reviews