From 3cb84ed17c2e86899c1a643251fe761f3e0ba345 Mon Sep 17 00:00:00 2001 From: Andrey Kamaev Date: Mon, 14 Jan 2013 18:16:04 +0400 Subject: [PATCH] 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 --- CMakeLists.txt | 6 +++++- cmake/OpenCVModule.cmake | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4ca9d17186..7831430e69 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -551,7 +551,11 @@ foreach(m ${OPENCV_MODULES_DISABLED_AUTO}) list(APPEND __mdeps ${d}) endif() 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() string(REPLACE "opencv_" "" OPENCV_MODULES_DISABLED_AUTO_ST "${OPENCV_MODULES_DISABLED_AUTO_ST}") diff --git a/cmake/OpenCVModule.cmake b/cmake/OpenCVModule.cmake index 9d5ce074b6..aba5c21e68 100644 --- a/cmake/OpenCVModule.cmake +++ b/cmake/OpenCVModule.cmake @@ -174,6 +174,7 @@ endmacro() # Internal macro; partly disables OpenCV 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(REMOVE_ITEM OPENCV_MODULES_BUILD "${the_module}") list(REMOVE_ITEM OPENCV_MODULES_PUBLIC "${the_module}") @@ -193,7 +194,7 @@ macro(__ocv_flatten_module_required_dependencies the_module) break() elseif(";${OPENCV_MODULES_DISABLED_USER};${OPENCV_MODULES_DISABLED_AUTO};" MATCHES ";${__dep};") __ocv_module_turn_off(${the_module}) # depends on disabled module - break() + list(APPEND __flattened_deps "${__dep}") elseif(";${OPENCV_MODULES_BUILD};" MATCHES ";${__dep};") if(";${__resolved_deps};" MATCHES ";${__dep};") 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}) set(HAVE_${m} ON CACHE INTERNAL "Module ${m} will be built in current configuration") __ocv_flatten_module_required_dependencies(${m}) + set(OPENCV_MODULE_${m}_DEPS ${OPENCV_MODULE_${m}_DEPS} CACHE INTERNAL "Flattened required dependencies of ${m} module") endforeach() foreach(m ${OPENCV_MODULES_BUILD}) @@ -286,7 +288,7 @@ macro(__ocv_flatten_module_dependencies) 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_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") endmacro()