3D mouse support from merwin-spacenav branch
[blender-staging.git] / CMakeLists.txt
index 455c3070e8f32e0acf571102a8e1b98243889f82..2ac6d67cd1c0c31e78715db7ebcd6931731ef806 100644 (file)
@@ -179,6 +179,7 @@ option(WITH_LZO           "Enable fast LZO compression (used for pointcache)" ON
 option(WITH_LZMA          "Enable best LZMA compression, (used for pointcache)" ON)
 
 # Misc
+option(WITH_NDOF "Enable NDOF input devices (SpaceNavigator and friends)" ON)
 option(WITH_RAYOPTIMIZATION    "Enable use of SIMD (SSE) optimizations for the raytracer" ON) 
 if(UNIX AND NOT APPLE)
        option(WITH_INSTALL_PORTABLE "Install redistributeable runtime, otherwise install into CMAKE_INSTALL_PREFIX" ON)
@@ -452,6 +453,15 @@ if(UNIX AND NOT APPLE)
                endif()
        endif()
 
+       if (WITH_NDOF)
+               if(CMAKE_SYSTEM_NAME MATCHES "Linux")
+                       set(NDOF /usr)
+                       set(NDOF_INC ${NDOF}/include)
+                       set(NDOF_LIBRARY spnav)
+                       set(NDOF_LIBPATH ${NDOF}/lib)
+               endif()
+       endif()
+
        # OpenSuse needs lutil, ArchLinux not, for now keep, can avoid by using --as-needed
        set(PLATFORM_LINKLIBS "-lutil -lc -lm -lpthread -lstdc++")
 
@@ -1029,6 +1039,10 @@ elseif(APPLE)
                set(TIFF_LIBPATH ${TIFF}/lib)
        endif()
 
+       if (WITH_NDOF)
+               # linker needs "-weak_framework 3DconnexionClient"
+       endif()
+
        set(EXETYPE MACOSX_BUNDLE)
 
        set(CMAKE_C_FLAGS_DEBUG "-fno-strict-aliasing -g")