From 28103ad386631b4735d854525b71ae68360ce531 Mon Sep 17 00:00:00 2001 From: Michae Gharbi Date: Tue, 11 Nov 2014 12:12:28 -0500 Subject: [PATCH] Fix Cuda -Wl linker options This line causes the following error when building custom projects that use OpenCV beta 3: ld: warning: directory not found for option '-L//-Wl,/usr/local/cuda' --- cmake/templates/OpenCVConfig.cmake.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/templates/OpenCVConfig.cmake.in b/cmake/templates/OpenCVConfig.cmake.in index b920d63802..0fa8048bba 100644 --- a/cmake/templates/OpenCVConfig.cmake.in +++ b/cmake/templates/OpenCVConfig.cmake.in @@ -292,7 +292,9 @@ foreach(__opttype OPT DBG) set(OpenCV_CUDA_LIBS_RELPATH "") foreach(l ${OpenCV_CUDA_LIBS_ABSPATH}) get_filename_component(_tmp ${l} PATH) - list(APPEND OpenCV_CUDA_LIBS_RELPATH ${_tmp}) + if(NOT ${_tmp} MATCHES "-Wl.*") + list(APPEND OpenCV_CUDA_LIBS_RELPATH ${_tmp}) + endif() endforeach() list(REMOVE_DUPLICATES OpenCV_CUDA_LIBS_RELPATH)