diff options
Diffstat (limited to 'video-ps3eye/CMakeLists.txt')
-rw-r--r-- | video-ps3eye/CMakeLists.txt | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/video-ps3eye/CMakeLists.txt b/video-ps3eye/CMakeLists.txt index 2fac5f9c..2f0bf50b 100644 --- a/video-ps3eye/CMakeLists.txt +++ b/video-ps3eye/CMakeLists.txt @@ -10,6 +10,7 @@ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/ps3eye-driver/CMakeLists.txt") if(libusb_FOUND) include_directories(SYSTEM ${libusb_INCLUDE_DIRS}) link_libraries(${libusb_LIBRARIES}) + link_directories(${libusb_LIBRARY_DIRS}) endif() else() set(SDK_LIBUSB CACHE PATH "") @@ -21,26 +22,14 @@ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/ps3eye-driver/CMakeLists.txt") endif() endif() -if(TARGET ps3eye-driver) - otr_module(video-ps3eye) - link_libraries(ps3eye-driver) - add_executable(ps3eye-subprocess "wrapper.cxx") - if(WIN32) - set(path "${SDK_LIBUSB}/libusb-1.0.dll") - if(EXISTS "${path}") - otr_install_lib("${path}" "${opentrack-hier-pfx}") - endif() - endif() -endif() - -if(TARGET ps3eye-sdl) - install(TARGETS "ps3eye-sdl" DESTINATION "${opentrack-hier-pfx}") +if(TARGET ps3eye-sdl AND FALSE) + install(TARGETS "ps3eye-sdl" DESTINATION "${opentrack-libexec}") if(WIN32) foreach(k ${SDL2_LIBRARIES}) get_filename_component(path "${k}" PATH) set(lib "${path}/SDL2.dll") if(EXISTS "${lib}") - otr_install_lib("${lib}" "${opentrack-hier-pfx}") + otr_install_lib("${lib}" "${opentrack-libexec}") break() endif() endforeach() @@ -48,9 +37,29 @@ if(TARGET ps3eye-sdl) endif() if(TARGET ps3eye-mode-test) - install(TARGETS "ps3eye-mode-test" DESTINATION "${opentrack-hier-pfx}") + install(TARGETS "ps3eye-mode-test" DESTINATION "${opentrack-libexec}") +endif() + +if(TARGET ps3eye-driver) + add_executable(ps3eye-subprocess "wrapper.cxx" "shm.cxx") + target_link_libraries(ps3eye-subprocess ps3eye-driver) + if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") + target_link_libraries(ps3eye-subprocess rt) + endif() + install(TARGETS "ps3eye-subprocess" DESTINATION "${opentrack-libexec}") +endif() + +if(TARGET ps3eye-subprocess) + otr_module(video-ps3eye) + target_link_libraries(${self} ps3eye-driver opentrack-video) + if(WIN32) + set(path "${SDK_LIBUSB}/libusb-1.0.dll") + if(EXISTS "${path}") + otr_install_lib("${path}" "${opentrack-libexec}") + endif() + endif() endif() if(TARGET ps3eye-frame-test) - install(TARGETS "ps3eye-frame-test" DESTINATION "${opentrack-hier-pfx}") + install(TARGETS "ps3eye-frame-test" DESTINATION "${opentrack-libexec}") endif() |