diff --git a/cmake/OpenCVDetectCUDA.cmake b/cmake/OpenCVDetectCUDA.cmake index 55b76f952..6a0cc2e19 100644 --- a/cmake/OpenCVDetectCUDA.cmake +++ b/cmake/OpenCVDetectCUDA.cmake @@ -64,6 +64,9 @@ if(CUDA_FOUND) message(STATUS "CUDA NVCC target flags: ${CUDA_NVCC_FLAGS}") + unset(CUDA_npp_LIBRARY CACHE) + find_cuda_helper_libs(npp) + macro(OCV_CUDA_COMPILE VAR) if (BUILD_SHARED_LIBS) set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -Xcompiler -DCVAPI_EXPORTS) diff --git a/modules/gpu/CMakeLists.txt b/modules/gpu/CMakeLists.txt index c5576e6bf..11ae79d76 100644 --- a/modules/gpu/CMakeLists.txt +++ b/modules/gpu/CMakeLists.txt @@ -50,8 +50,6 @@ if (HAVE_CUDA) OCV_CUDA_COMPILE(cuda_objs ${lib_cuda} ${ncv_cuda}) #CUDA_BUILD_CLEAN_TARGET() - unset(CUDA_npp_LIBRARY CACHE) - find_cuda_helper_libs(npp) set(cuda_link_libs ${CUDA_LIBRARIES} ${CUDA_npp_LIBRARY}) else() set(lib_cuda "")