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