summaryrefslogtreecommitdiffhomepage
path: root/video-ps3eye/CMakeLists.txt
blob: 83bac8f3ed062bd8f05aa31bc108e0c234e5d470 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
if(WIN32)
    if(MSVC)
        set(SDK_LIBUSB "" CACHE PATH "")
    else()
        include(FindPkgConfig)
        if(PKG_CONFIG_FOUND)
            pkg_check_modules(lusb QUIET "libusb")
        endif()
    endif()

    set(found FALSE)
    if(MSVC)
        if(SDK_LIBUSB)
            set(found TRUE)
            link_directories("${SDK_LIBUSB}")
            include_directories("${SDK_LIBUSB}")

            if(WIN32)
                set(path "${SDK_LIBUSB}/libusb-1.0.dll")
                if(EXISTS "${path}")
                    otr_install_lib("${path}" "${opentrack-hier-pfx}")
                endif()
            endif()
        endif()
    elseif(lusb_FOUND)
        set(found TRUE)
        add_definitions(${lusb_CFLAGS})
        link_directories(${lusb_LIBRARY_DIRS})
        include_directories(${lusb_INCLUDE_DIRS})
        add_link_options(${lusb_LDFLAGS})
        link_libraries(${lusb_LIBRARIES})
        if(WIN32)
            otr_install_lib(libusb "${opentrack-hier-path}")
        endif()
    endif()

    if(found)
        add_subdirectory("PS3EYEDriver")
        otr_module(video-ps3eye)
    endif()
endif()