From 17e20b2c60ec780eb232a85819cbc446502ba946 Mon Sep 17 00:00:00 2001
From: Vladislav Vinogradov <vlad.vinogradov@itseez.com>
Date: Fri, 30 Aug 2013 14:46:47 +0400
Subject: [PATCH] fix for bug #3219 (undefined reference in GPU samples)

---
 samples/gpu/CMakeLists.txt | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/samples/gpu/CMakeLists.txt b/samples/gpu/CMakeLists.txt
index fc109684c..7219b76ab 100644
--- a/samples/gpu/CMakeLists.txt
+++ b/samples/gpu/CMakeLists.txt
@@ -40,6 +40,11 @@ if(BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND)
     add_executable(${the_target} ${srcs})
 
     target_link_libraries(${the_target} ${OPENCV_LINKER_LIBS} ${OPENCV_GPU_SAMPLES_REQUIRED_DEPS})
+
+    if(HAVE_CUDA)
+      target_link_libraries(${the_target} ${CUDA_CUDA_LIBRARY})
+    endif()
+
     if(HAVE_opencv_nonfree)
       target_link_libraries(${the_target} opencv_nonfree)
     endif()