diff options
author | Jonathan "Geenz" Goodman <geenz@geenzo.com> | 2023-03-31 10:54:22 -0700 |
---|---|---|
committer | Jonathan "Geenz" Goodman <geenz@geenzo.com> | 2023-03-31 10:54:22 -0700 |
commit | 4e306c90666094a7450f4d6f3ed7c8b71527e393 (patch) | |
tree | 4e52cfe3cfc7df8060ec5336f53d91636986b43c /indra/cmake/NDOF.cmake | |
parent | b44ad50f75724a5d9e53bd52d2724111568caf24 (diff) | |
parent | 7d144fcb2a1b0aff1b59e378c652649c3d03e94f (diff) |
Merge branch 'DRTVWR-559' of https://github.com/secondlife/viewer into DRTVWR-559
Diffstat (limited to 'indra/cmake/NDOF.cmake')
-rw-r--r-- | indra/cmake/NDOF.cmake | 40 |
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) |