Fix dependencies inference for auto-disabled targets

Sometimes information about dependencies causing disabling were loosed and it
was not possible to correctly display these dependencies in status report
This commit is contained in:
Andrey Kamaev 2013-01-14 18:16:04 +04:00
parent c49b23d4dd
commit 3cb84ed17c
2 changed files with 9 additions and 3 deletions

View File

@ -551,7 +551,11 @@ foreach(m ${OPENCV_MODULES_DISABLED_AUTO})
list(APPEND __mdeps ${d}) list(APPEND __mdeps ${d})
endif() endif()
endforeach() endforeach()
list(APPEND OPENCV_MODULES_DISABLED_AUTO_ST "${m}(deps: ${__mdeps})") if(__mdeps)
list(APPEND OPENCV_MODULES_DISABLED_AUTO_ST "${m}(deps: ${__mdeps})")
else()
list(APPEND OPENCV_MODULES_DISABLED_AUTO_ST "${m}")
endif()
endforeach() endforeach()
string(REPLACE "opencv_" "" OPENCV_MODULES_DISABLED_AUTO_ST "${OPENCV_MODULES_DISABLED_AUTO_ST}") string(REPLACE "opencv_" "" OPENCV_MODULES_DISABLED_AUTO_ST "${OPENCV_MODULES_DISABLED_AUTO_ST}")

View File

@ -174,6 +174,7 @@ endmacro()
# Internal macro; partly disables OpenCV module # Internal macro; partly disables OpenCV module
macro(__ocv_module_turn_off the_module) macro(__ocv_module_turn_off the_module)
list(REMOVE_ITEM OPENCV_MODULES_DISABLED_AUTO "${the_module}")
list(APPEND OPENCV_MODULES_DISABLED_AUTO "${the_module}") list(APPEND OPENCV_MODULES_DISABLED_AUTO "${the_module}")
list(REMOVE_ITEM OPENCV_MODULES_BUILD "${the_module}") list(REMOVE_ITEM OPENCV_MODULES_BUILD "${the_module}")
list(REMOVE_ITEM OPENCV_MODULES_PUBLIC "${the_module}") list(REMOVE_ITEM OPENCV_MODULES_PUBLIC "${the_module}")
@ -193,7 +194,7 @@ macro(__ocv_flatten_module_required_dependencies the_module)
break() break()
elseif(";${OPENCV_MODULES_DISABLED_USER};${OPENCV_MODULES_DISABLED_AUTO};" MATCHES ";${__dep};") elseif(";${OPENCV_MODULES_DISABLED_USER};${OPENCV_MODULES_DISABLED_AUTO};" MATCHES ";${__dep};")
__ocv_module_turn_off(${the_module}) # depends on disabled module __ocv_module_turn_off(${the_module}) # depends on disabled module
break() list(APPEND __flattened_deps "${__dep}")
elseif(";${OPENCV_MODULES_BUILD};" MATCHES ";${__dep};") elseif(";${OPENCV_MODULES_BUILD};" MATCHES ";${__dep};")
if(";${__resolved_deps};" MATCHES ";${__dep};") if(";${__resolved_deps};" MATCHES ";${__dep};")
list(APPEND __flattened_deps "${__dep}") # all dependencies of this module are already resolved list(APPEND __flattened_deps "${__dep}") # all dependencies of this module are already resolved
@ -262,6 +263,7 @@ macro(__ocv_flatten_module_dependencies)
foreach(m ${OPENCV_MODULES_BUILD}) foreach(m ${OPENCV_MODULES_BUILD})
set(HAVE_${m} ON CACHE INTERNAL "Module ${m} will be built in current configuration") set(HAVE_${m} ON CACHE INTERNAL "Module ${m} will be built in current configuration")
__ocv_flatten_module_required_dependencies(${m}) __ocv_flatten_module_required_dependencies(${m})
set(OPENCV_MODULE_${m}_DEPS ${OPENCV_MODULE_${m}_DEPS} CACHE INTERNAL "Flattened required dependencies of ${m} module")
endforeach() endforeach()
foreach(m ${OPENCV_MODULES_BUILD}) foreach(m ${OPENCV_MODULES_BUILD})
@ -286,7 +288,7 @@ macro(__ocv_flatten_module_dependencies)
ocv_list_unique(OPENCV_MODULES_BUILD_) ocv_list_unique(OPENCV_MODULES_BUILD_)
set(OPENCV_MODULES_PUBLIC ${OPENCV_MODULES_PUBLIC} CACHE INTERNAL "List of OpenCV modules marked for export") set(OPENCV_MODULES_PUBLIC ${OPENCV_MODULES_PUBLIC} CACHE INTERNAL "List of OpenCV modules marked for export")
set(OPENCV_MODULES_BUILD ${OPENCV_MODULES_BUILD_} CACHE INTERNAL "List of OpenCV modules included into the build") set(OPENCV_MODULES_BUILD ${OPENCV_MODULES_BUILD_} CACHE INTERNAL "List of OpenCV modules included into the build")
set(OPENCV_MODULES_DISABLED_AUTO ${OPENCV_MODULES_DISABLED_AUTO} CACHE INTERNAL "List of OpenCV modules implicitly disabled due to dependencies") set(OPENCV_MODULES_DISABLED_AUTO ${OPENCV_MODULES_DISABLED_AUTO} CACHE INTERNAL "List of OpenCV modules implicitly disabled due to dependencies")
endmacro() endmacro()