Skip to content

Commit c4a3278

Browse files
committed
Fix build with CUDA on windows with JOM and Ninja (opencv#6372)
1 parent 89fcd6d commit c4a3278

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,11 @@ if(HAVE_CUDA)
701701
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${CUDA_cufft_LIBRARY})
702702
endif()
703703
foreach(p ${CUDA_LIBS_PATH})
704-
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${CMAKE_LIBRARY_PATH_FLAG}${p})
704+
if(MSVC AND CMAKE_GENERATOR MATCHES "Ninja|JOM")
705+
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${CMAKE_LIBRARY_PATH_FLAG}"${p}")
706+
else()
707+
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${CMAKE_LIBRARY_PATH_FLAG}${p})
708+
endif()
705709
endforeach()
706710
endif()
707711
# ----------------------------------------------------------------------------

0 commit comments

Comments
 (0)