1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-21 19:33:03 +04:00

Check CMake target before use

This commit is contained in:
Dmitry Kurtaev
2025-10-01 13:41:05 +03:00
parent da8c313a90
commit 4cb91806b1
+3 -1
View File
@@ -210,8 +210,10 @@ endif()
ocv_add_accuracy_tests()
ocv_add_perf_tests()
if (HAVE_CUDA)
if (TARGET opencv_test_core AND HAVE_CUDA)
ocv_target_compile_definitions(opencv_test_core PRIVATE "HAVE_CUDA=1")
endif()
if (TARGET opencv_perf_core AND HAVE_CUDA)
ocv_target_compile_definitions(opencv_perf_core PRIVATE "HAVE_CUDA=1")
endif()