Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

opencv wrapper: Use the CMake OpenCV finder instead of naming librari…

…es explicitly.

Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
  • Loading branch information...
commit 8755990eda72a32408a07e803e08932a9e523e16 1 parent e7eed98
@zarvox zarvox authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 wrappers/opencv/CMakeLists.txt
View
5 wrappers/opencv/CMakeLists.txt
@@ -1,6 +1,7 @@
######################################################################################
# OpenCV Interface
######################################################################################
+find_package(OpenCV REQUIRED)
@floe Collaborator
floe added a note

I'm a bit cmake-impaired - does this mean it's still possible to compile without OpenCV or not?

@zarvox Collaborator
zarvox added a note

This is fine - if you disable BUILD_CV in the root CMakeLists.txt, this whole subdirectory gets ignored.

And presumably, OpenCV is required to build the OpenCV wrapper.

@floe Collaborator
floe added a note

Ah, I didn't notice this is a subdir. Sorry for the noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
add_library (freenect_cv SHARED libfreenect_cv.c)
set_target_properties (freenect_cv PROPERTIES
VERSION ${PROJECT_VER}
@@ -8,7 +9,7 @@ set_target_properties (freenect_cv PROPERTIES
include_directories (../c_sync)
-target_link_libraries (freenect_cv freenect_sync cv)
+target_link_libraries (freenect_cv freenect_sync ${OpenCV_LIBS})
install (TARGETS freenect_cv
DESTINATION "${PROJECT_LIBRARY_INSTALL_DIR}")
@@ -16,6 +17,6 @@ install (FILES "libfreenect_cv.h"
DESTINATION ${PROJECT_INCLUDE_INSTALL_DIR})
add_executable(cvdemo cvdemo.c)
-target_link_libraries(cvdemo freenect freenect_sync freenect_cv cv cxcore highgui)
+target_link_libraries(cvdemo freenect freenect_sync freenect_cv ${OpenCV_LIBS})
install (TARGETS cvdemo
DESTINATION bin)
Please sign in to comment.
Something went wrong with that request. Please try again.