Permalink
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...
1 parent e7eed98 commit 8755990eda72a32408a07e803e08932a9e523e16 @zarvox zarvox committed Nov 14, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 wrappers/opencv/CMakeLists.txt
@@ -1,21 +1,22 @@
######################################################################################
# OpenCV Interface
######################################################################################
+find_package(OpenCV REQUIRED)
floe
floe Nov 17, 2011 Contributor

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

zarvox
zarvox Nov 17, 2011 Member

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
floe Nov 17, 2011 Contributor

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

add_library (freenect_cv SHARED libfreenect_cv.c)
set_target_properties (freenect_cv PROPERTIES
VERSION ${PROJECT_VER}
SOVERSION ${PROJECT_APIVER})
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}")
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)

0 comments on commit 8755990

Please sign in to comment.