From 2ca4283828183949f020202b315de789abb51264 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Sat, 17 Jun 2017 12:02:26 +1200 Subject: [PATCH] Fix Leap Motion SDK access --- cmake/macros/TargetLeapMotion.cmake | 12 ++++++++++++ plugins/hifiLeapMotion/CMakeLists.txt | 13 ++++++------- plugins/hifiLeapMotion/src/LeapMotionPlugin.h | 3 +++ 3 files changed, 21 insertions(+), 7 deletions(-) create mode 100644 cmake/macros/TargetLeapMotion.cmake diff --git a/cmake/macros/TargetLeapMotion.cmake b/cmake/macros/TargetLeapMotion.cmake new file mode 100644 index 0000000000..674ec8f62d --- /dev/null +++ b/cmake/macros/TargetLeapMotion.cmake @@ -0,0 +1,12 @@ +# +# Created by David Rowe on 16 Jun 2017. +# Copyright 2017 High Fidelity, Inc. +# +# Distributed under the Apache License, Version 2.0. +# See the accompanying file LICENSE or http:#www.apache.org/licenses/LICENSE-2.0.html +# + +macro(TARGET_LEAPMOTION) + target_include_directories(${TARGET_NAME} PRIVATE ${LEAPMOTION_INCLUDE_DIRS}) + target_link_libraries(${TARGET_NAME} ${LEAPMOTION_LIBRARIES}) +endmacro() diff --git a/plugins/hifiLeapMotion/CMakeLists.txt b/plugins/hifiLeapMotion/CMakeLists.txt index ee2fb22f0e..14f9bbaa17 100644 --- a/plugins/hifiLeapMotion/CMakeLists.txt +++ b/plugins/hifiLeapMotion/CMakeLists.txt @@ -6,11 +6,10 @@ # See the accompanying file LICENSE or http:#www.apache.org/licenses/LICENSE-2.0.html # -if (WIN32) - find_package(LEAPMOTION) - if (LEAPMOTION_FOUND) - set(TARGET_NAME hifiLeapMotion) - setup_hifi_plugin(Script Qml Widgets) - link_hifi_libraries(shared controllers ui plugins input-plugins) - endif() +find_package(LEAPMOTION) +if (LEAPMOTION_FOUND) + set(TARGET_NAME hifiLeapMotion) + setup_hifi_plugin(Script Qml Widgets) + link_hifi_libraries(shared controllers ui plugins input-plugins) + target_leapmotion() endif() diff --git a/plugins/hifiLeapMotion/src/LeapMotionPlugin.h b/plugins/hifiLeapMotion/src/LeapMotionPlugin.h index d6fe6d8a55..f42d4ccaf5 100644 --- a/plugins/hifiLeapMotion/src/LeapMotionPlugin.h +++ b/plugins/hifiLeapMotion/src/LeapMotionPlugin.h @@ -14,6 +14,9 @@ #include #include +// LeapMotion SDK +#include + class LeapMotionPlugin : public InputPlugin { Q_OBJECT