From 7a3b0785d7abdf12f55354c1dedd3a2949e5cbbf Mon Sep 17 00:00:00 2001 From: Anatoly Baksheev Date: Wed, 6 Oct 2010 12:45:31 +0000 Subject: [PATCH] fixed gpu module build system (in case when WITH_CUDA is set, but CUDA Toolkit is not found) --- modules/gpu/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/gpu/CMakeLists.txt b/modules/gpu/CMakeLists.txt index ceacd908bd..9632d10791 100644 --- a/modules/gpu/CMakeLists.txt +++ b/modules/gpu/CMakeLists.txt @@ -100,7 +100,11 @@ set_target_properties(${the_target} PROPERTIES ) # Add the required libraries for linking: -target_link_libraries(${the_target} ${OPENCV_LINKER_LIBS} ${IPP_LIBS} ${DEPS} ${CUDA_LIBRARIES} ${CUDA_NPP_LIBRARIES}) +target_link_libraries(${the_target} ${OPENCV_LINKER_LIBS} ${IPP_LIBS} ${DEPS}) + +if (HAVE_CUDA) + target_link_libraries(${the_target} ${CUDA_LIBRARIES} ${CUDA_NPP_LIBRARIES}) +endif() if(MSVC) if(CMAKE_CROSSCOMPILING)