From 1993601389885cfc8d9cb2202a6264cbccf5f61e Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 2 Jul 2013 15:27:30 -0700 Subject: [PATCH] don't link a NOTFOUND leap library --- cmake/modules/FindLeap.cmake | 4 ++-- interface/CMakeLists.txt | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/cmake/modules/FindLeap.cmake b/cmake/modules/FindLeap.cmake index 121d422131..f93499b4d2 100755 --- a/cmake/modules/FindLeap.cmake +++ b/cmake/modules/FindLeap.cmake @@ -32,9 +32,9 @@ else (LEAP_LIBRARIES AND LEAP_INCLUDE_DIRS) endif () # If we're using the Leap stubs, there's only a header, no lib. - if (LEAP_INCLUDE_DIRS) + if (LEAP_LIBRARIES AND LEAP_INCLUDE_DIRS) set(LEAP_FOUND TRUE) - endif (LEAP_INCLUDE_DIRS) + endif (LEAP_LIBRARIES AND LEAP_INCLUDE_DIRS) if (LEAP_FOUND) if (NOT Leap_FIND_QUIETLY) diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index e7086e22be..385f050b86 100755 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -153,8 +153,12 @@ if (APPLE) ${QuartzCore} ${UVCCAMERACONTROL_LIBRARIES} ${LIBOVR_LIBRARIES} - ${LEAP_LIBRARIES} ) + + if (LEAP_FOUND) + target_link_libraries(${TARGET_NAME} ${LEAP_LIBRARIES}) + endif(LEAP_FOUND) + else (APPLE) find_package(OpenGL REQUIRED) find_package(GLUT REQUIRED)