https://github.com/jherico/cmake
Raw File
Tip revision: f3ff9f5ab522ab24adc716db66b3c3c1890f1f62 authored by Brad Davis on 21 December 2014, 21:38 UTC
Adding scrub 3dx finder
Tip revision: f3ff9f5
FindLeapMotion.cmake
# This script locates the PERC SDK
# ------------------------------------
#
# usage:
# find_package(PERC ...)
#
# searches in LeapMotion_ROOT and usual locations
#
# Sets LeapMotion_INCLUDE_DIR, LeapMotion_LIBRARY_STATIC and LeapMotion_LIBRARY_DYNAMIC

set(LeapMotion_POSSIBLE_PATHS
    ${LeapMotion_DIR}
    $ENV{LeapMotion_DIR}
)

find_path(LeapMotion_INCLUDE_DIR 
    NAMES Leap.h
    PATH_SUFFIXES "include"
    PATHS ${LeapMotion_POSSIBLE_PATHS}
)

find_library(LeapMotion_LIBRARY
    NAMES Leap Leapd
    PATH_SUFFIXES "lib/x86"
    PATHS ${LeapMotion_POSSIBLE_PATHS}
)

set(CMAKE_FIND_LIBRARY_SUFFIXES_SAVE ${CMAKE_FIND_LIBRARY_SUFFIXES})
if (WIN32)
    set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll")
elseif(APPLE)
else()
    set(CMAKE_FIND_LIBRARY_SUFFIXES ".so")
endif()
find_library(LeapMotion_BINARY
    NAMES Leap Leapd
    PATH_SUFFIXES "lib/x86"
    PATHS ${LeapMotion_POSSIBLE_PATHS}
)
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SAVE})

find_package_handle_standard_args(LeapMotion 
    FOUND_VAR LeapMotion_FOUND
    REQUIRED_VARS LeapMotion_LIBRARY LeapMotion_INCLUDE_DIR LeapMotion_BINARY)
back to top