summaryrefslogtreecommitdiff
path: root/indra/cmake/NDOF.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'indra/cmake/NDOF.cmake')
-rw-r--r--indra/cmake/NDOF.cmake40
1 files changed, 14 insertions, 26 deletions
diff --git a/indra/cmake/NDOF.cmake b/indra/cmake/NDOF.cmake
index 388df16a52..b88fbccf2a 100644
--- a/indra/cmake/NDOF.cmake
+++ b/indra/cmake/NDOF.cmake
@@ -3,34 +3,22 @@ include(Prebuilt)
set(NDOF ON CACHE BOOL "Use NDOF space navigator joystick library.")
-if (NDOF)
- if (USESYSTEMLIBS)
- set(NDOF_FIND_REQUIRED ON)
- include(FindNDOF)
- else (USESYSTEMLIBS)
- if (WINDOWS OR DARWIN)
- use_prebuilt_binary(libndofdev)
- elseif (LINUX)
- use_prebuilt_binary(open-libndofdev)
- endif (WINDOWS OR DARWIN)
+include_guard()
+add_library( ll::ndof INTERFACE IMPORTED )
- if (WINDOWS)
- set(NDOF_LIBRARY libndofdev)
- elseif (DARWIN OR LINUX)
- set(NDOF_LIBRARY ndofdev)
- endif (WINDOWS)
+if (NDOF)
+ if (WINDOWS OR DARWIN)
+ use_prebuilt_binary(libndofdev)
+ elseif (LINUX)
+ use_prebuilt_binary(open-libndofdev)
+ endif (WINDOWS OR DARWIN)
- set(NDOF_INCLUDE_DIR ${ARCH_PREBUILT_DIRS}/include/ndofdev)
- set(NDOF_FOUND 1)
- endif (USESYSTEMLIBS)
+ if (WINDOWS)
+ target_link_libraries( ll::ndof INTERFACE libndofdev)
+ elseif (DARWIN OR LINUX)
+ target_link_libraries( ll::ndof INTERFACE ndofdev)
+ endif (WINDOWS)
+ target_compile_definitions( ll::ndof INTERFACE LIB_NDOF=1)
endif (NDOF)
-if (NDOF_FOUND)
- add_definitions(-DLIB_NDOF=1)
- 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)