From 7afce8e003de049ab2075fb9aadbcacde4d45697 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Sat, 12 Dec 2015 14:56:59 +0300 Subject: [PATCH] world build: fix modules instantiation order opencv_hal before opencv_world opencv_world before opencv_ts --- cmake/OpenCVModule.cmake | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/cmake/OpenCVModule.cmake b/cmake/OpenCVModule.cmake index 0f212acf12..d6cdd0402c 100644 --- a/cmake/OpenCVModule.cmake +++ b/cmake/OpenCVModule.cmake @@ -305,9 +305,10 @@ macro(ocv_glob_modules) set(OPENCV_INITIAL_PASS OFF PARENT_SCOPE) set(OPENCV_INITIAL_PASS OFF) if(${BUILD_opencv_world}) - add_subdirectory("${OPENCV_MODULE_opencv_world_LOCATION}" "${CMAKE_CURRENT_BINARY_DIR}/world") foreach(m ${OPENCV_MODULES_BUILD}) - if(NOT OPENCV_MODULE_${m}_IS_PART_OF_WORLD AND NOT ${m} STREQUAL opencv_world) + if("${m}" STREQUAL opencv_world) + add_subdirectory("${OPENCV_MODULE_opencv_world_LOCATION}" "${CMAKE_CURRENT_BINARY_DIR}/world") + elseif(NOT OPENCV_MODULE_${m}_IS_PART_OF_WORLD AND NOT ${m} STREQUAL opencv_world) message(STATUS "Processing module ${m}...") if(m MATCHES "^opencv_") string(REGEX REPLACE "^opencv_" "" __shortname "${m}") @@ -446,6 +447,17 @@ function(__ocv_resolve_dependencies) list(APPEND deps_${m} ${d}) set(has_changes ON) endif() + if(BUILD_opencv_world + AND NOT "${m}" STREQUAL "opencv_world" + AND NOT "${m2}" STREQUAL "opencv_world" + AND OPENCV_MODULE_${m2}_IS_PART_OF_WORLD + AND NOT OPENCV_MODULE_${m}_IS_PART_OF_WORLD) + if(NOT (";${deps_${m}};" MATCHES ";opencv_world;")) +# message(STATUS " Transfer dependency opencv_world alias ${m2} to ${m}") + list(APPEND deps_${m} opencv_world) + set(has_changes ON) + endif() + endif() endforeach() endif() endforeach()