From e582709185a192fb41853e58977befceb022578e Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 17 Feb 2015 15:22:22 -0800 Subject: [PATCH] ensure leapmotion dll path is found --- cmake/modules/FindLeapMotion.cmake | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/cmake/modules/FindLeapMotion.cmake b/cmake/modules/FindLeapMotion.cmake index 6ccba0ea66..6b9d4355f7 100644 --- a/cmake/modules/FindLeapMotion.cmake +++ b/cmake/modules/FindLeapMotion.cmake @@ -21,8 +21,7 @@ if (WIN32) find_library(LEAPMOTION_LIBRARY_DEBUG Leapd PATH_SUFFIXES lib/x86 HINTS ${LEAPMOTION_SEARCH_DIRS}) find_library(LEAPMOTION_LIBRARY_RELEASE Leap PATH_SUFFIXES lib/x86 HINTS ${LEAPMOTION_SEARCH_DIRS}) - get_filename_component(LEAPMOTION_DLL_PATH ${LEAPMOTION_LIBRARY_RELEASE} DIRECTORY CACHE) - add_paths_to_lib_paths(${LEAPMOTION_DLL_PATH}) + find_path(LEAPMOTION_DLL_PATH Leap.dll PATH_SUFFIXES lib/x86 HINTS ${LEAPMOTION_SEARCH_DIRS}) elseif (APPLE) find_library(LEAPMOTION_LIBRARY_RELEASE Leap PATH_SUFFIXES lib HINTS ${LEAPMOTION_SEARCH_DIRS}) endif () @@ -32,7 +31,16 @@ select_library_configurations(LEAPMOTION) set(LEAPMOTION_LIBRARIES "${LEAPMOTION_LIBRARY}") +set(LEAPMOTION_REQUIREMENTS LEAPMOTION_INCLUDE_DIRS LEAPMOTION_LIBRARIES) +if (WIN32) + list(APPEND LEAPMOTION_REQUIREMENTS LEAPMOTION_DLL_PATH) +endif () + include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(LeapMotion DEFAULT_MSG LEAPMOTION_INCLUDE_DIRS LEAPMOTION_LIBRARIES) +find_package_handle_standard_args(LeapMotion DEFAULT_MSG LEAPMOTION_REQUIREMENTS) + +if (WIN32) + add_paths_to_lib_paths(${LEAPMOTION_DLL_PATH}) +endif () mark_as_advanced(LEAPMOTION_INCLUDE_DIRS LEAPMOTION_LIBRARIES LEAPMOTION_SEARCH_DIRS)