File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -421,6 +421,41 @@ function(__ocv_resolve_dependencies)
421
421
set (HAVE_${m} ON CACHE INTERNAL "Module ${m} will be built in current configuration" )
422
422
endforeach ()
423
423
424
+ # Whitelist feature
425
+ if (BUILD_LIST )
426
+ # Prepare the list
427
+ string (REGEX REPLACE "[ ,:]+" ";" whitelist "${BUILD_LIST} " )
428
+ if (BUILD_opencv_world )
429
+ list (APPEND whitelist world )
430
+ endif ()
431
+ ocv_list_add_prefix (whitelist "opencv_" )
432
+ ocv_list_sort (whitelist )
433
+ ocv_list_unique (whitelist )
434
+ message (STATUS "Using whitelist: ${whitelist} " )
435
+ # Expand the list
436
+ foreach (depth RANGE 10 )
437
+ set (new_whitelist ${whitelist} )
438
+ foreach (m ${whitelist} )
439
+ list (APPEND new_whitelist ${OPENCV_MODULE_${m}_REQ_DEPS} )
440
+ list (APPEND new_whitelist ${OPENCV_MODULE_${m}_PRIVATE_REQ_DEPS} )
441
+ endforeach ()
442
+ ocv_list_sort (new_whitelist )
443
+ ocv_list_unique (new_whitelist )
444
+ if ("${whitelist} " STREQUAL "${new_whitelist} " )
445
+ break ()
446
+ endif ()
447
+ set (whitelist "${new_whitelist} " )
448
+ endforeach ()
449
+ # Disable modules not in whitelist
450
+ foreach (m ${OPENCV_MODULES_BUILD} )
451
+ list (FIND whitelist ${m} idx )
452
+ if (idx EQUAL -1 )
453
+ message (STATUS "Module ${m} disabled by whitelist" )
454
+ __ocv_module_turn_off (${m} )
455
+ endif ()
456
+ endforeach ()
457
+ endif ()
458
+
424
459
# disable MODULES with unresolved dependencies
425
460
set (has_changes ON )
426
461
while (has_changes )
You can’t perform that action at this time.
0 commit comments