|
|
@ -164,7 +164,7 @@ macro(ocv_add_module _name) |
|
|
|
set(OPENCV_MODULE_${the_module}_LINK_DEPS "" CACHE INTERNAL "") |
|
|
|
set(OPENCV_MODULE_${the_module}_LINK_DEPS "" CACHE INTERNAL "") |
|
|
|
|
|
|
|
|
|
|
|
# parse list of dependencies |
|
|
|
# parse list of dependencies |
|
|
|
if("${ARGV1}" STREQUAL "INTERNAL" OR "${ARGV1}" STREQUAL "BINDINGS") |
|
|
|
if(" ${ARGV1}" STREQUAL " INTERNAL" OR " ${ARGV1}" STREQUAL " BINDINGS") |
|
|
|
set(OPENCV_MODULE_${the_module}_CLASS "${ARGV1}" CACHE INTERNAL "The category of the module") |
|
|
|
set(OPENCV_MODULE_${the_module}_CLASS "${ARGV1}" CACHE INTERNAL "The category of the module") |
|
|
|
set(__ocv_argn__ ${ARGN}) |
|
|
|
set(__ocv_argn__ ${ARGN}) |
|
|
|
list(REMOVE_AT __ocv_argn__ 0) |
|
|
|
list(REMOVE_AT __ocv_argn__ 0) |
|
|
@ -257,7 +257,7 @@ endmacro() |
|
|
|
# Usage: _glob_locations(<output paths list> <output names list> <folder> [<folder> ...]) |
|
|
|
# Usage: _glob_locations(<output paths list> <output names list> <folder> [<folder> ...]) |
|
|
|
function(_glob_locations out_paths out_names) |
|
|
|
function(_glob_locations out_paths out_names) |
|
|
|
foreach(path ${ARGN}) |
|
|
|
foreach(path ${ARGN}) |
|
|
|
message(STATUS "Inspect: ${path}") |
|
|
|
#message(STATUS "Inspect: ${path}") |
|
|
|
list(LENGTH paths before) |
|
|
|
list(LENGTH paths before) |
|
|
|
get_filename_component(path "${path}" ABSOLUTE) |
|
|
|
get_filename_component(path "${path}" ABSOLUTE) |
|
|
|
# Either module itself |
|
|
|
# Either module itself |
|
|
@ -269,7 +269,7 @@ function(_glob_locations out_paths out_names) |
|
|
|
# Either flat collection of modules |
|
|
|
# Either flat collection of modules |
|
|
|
file(GLOB subdirs RELATIVE "${path}" "${path}/*") |
|
|
|
file(GLOB subdirs RELATIVE "${path}" "${path}/*") |
|
|
|
foreach(subdir ${subdirs}) |
|
|
|
foreach(subdir ${subdirs}) |
|
|
|
message(STATUS "Inspect: ${path}/${subdir}") |
|
|
|
#message(STATUS "Inspect: ${path}/${subdir}") |
|
|
|
if(EXISTS "${path}/${subdir}/CMakeLists.txt") |
|
|
|
if(EXISTS "${path}/${subdir}/CMakeLists.txt") |
|
|
|
list(APPEND paths "${path}/${subdir}") |
|
|
|
list(APPEND paths "${path}/${subdir}") |
|
|
|
list(APPEND names "${subdir}") |
|
|
|
list(APPEND names "${subdir}") |
|
|
@ -302,7 +302,7 @@ function(_add_modules_1 paths names) |
|
|
|
foreach(i RANGE ${len}) |
|
|
|
foreach(i RANGE ${len}) |
|
|
|
list(GET ${paths} ${i} path) |
|
|
|
list(GET ${paths} ${i} path) |
|
|
|
list(GET ${names} ${i} name) |
|
|
|
list(GET ${names} ${i} name) |
|
|
|
message(STATUS "First pass: ${name} => ${path}") |
|
|
|
#message(STATUS "First pass: ${name} => ${path}") |
|
|
|
include("${path}/cmake/init.cmake" OPTIONAL) |
|
|
|
include("${path}/cmake/init.cmake" OPTIONAL) |
|
|
|
add_subdirectory("${path}" "${CMAKE_CURRENT_BINARY_DIR}/.firstpass/${name}") |
|
|
|
add_subdirectory("${path}" "${CMAKE_CURRENT_BINARY_DIR}/.firstpass/${name}") |
|
|
|
endforeach() |
|
|
|
endforeach() |
|
|
@ -320,7 +320,7 @@ function(_add_modules_2) |
|
|
|
message(WARNING "Incorrect module name: ${m}") |
|
|
|
message(WARNING "Incorrect module name: ${m}") |
|
|
|
endif() |
|
|
|
endif() |
|
|
|
string(REGEX REPLACE "^opencv_" "" name "${m}") |
|
|
|
string(REGEX REPLACE "^opencv_" "" name "${m}") |
|
|
|
message(STATUS "Second pass: ${name} => ${OPENCV_MODULE_${m}_LOCATION}") |
|
|
|
#message(STATUS "Second pass: ${name} => ${OPENCV_MODULE_${m}_LOCATION}") |
|
|
|
add_subdirectory("${OPENCV_MODULE_${m}_LOCATION}" "${CMAKE_CURRENT_BINARY_DIR}/${name}") |
|
|
|
add_subdirectory("${OPENCV_MODULE_${m}_LOCATION}" "${CMAKE_CURRENT_BINARY_DIR}/${name}") |
|
|
|
endif() |
|
|
|
endif() |
|
|
|
endforeach() |
|
|
|
endforeach() |
|
|
@ -427,7 +427,7 @@ function(__ocv_sort_modules_by_deps __lst) |
|
|
|
break() |
|
|
|
break() |
|
|
|
endif() |
|
|
|
endif() |
|
|
|
else() |
|
|
|
else() |
|
|
|
message(FATAL_ERROR WARNING "Unresolved dependencies or loop in dependency graph (${length_after})\n" |
|
|
|
message(FATAL_ERROR "FATAL: Unresolved dependencies or loop in dependency graph (${length_after})\n" |
|
|
|
"Processed ${__lst}: ${${__lst}}\n" |
|
|
|
"Processed ${__lst}: ${${__lst}}\n" |
|
|
|
"Good modules: ${result}\n" |
|
|
|
"Good modules: ${result}\n" |
|
|
|
"Bad modules: ${input}" |
|
|
|
"Bad modules: ${input}" |
|
|
@ -652,12 +652,14 @@ endmacro() |
|
|
|
# setup include paths for the list of passed modules |
|
|
|
# setup include paths for the list of passed modules |
|
|
|
macro(ocv_target_include_modules target) |
|
|
|
macro(ocv_target_include_modules target) |
|
|
|
foreach(d ${ARGN}) |
|
|
|
foreach(d ${ARGN}) |
|
|
|
if(d MATCHES "^opencv_" AND HAVE_${d}) |
|
|
|
if(d MATCHES "^opencv_") |
|
|
|
if (EXISTS "${OPENCV_MODULE_${d}_LOCATION}/include") |
|
|
|
if(HAVE_${d} AND EXISTS "${OPENCV_MODULE_${d}_LOCATION}/include") |
|
|
|
ocv_target_include_directories(${target} "${OPENCV_MODULE_${d}_LOCATION}/include") |
|
|
|
ocv_target_include_directories(${target} "${OPENCV_MODULE_${d}_LOCATION}/include") |
|
|
|
endif() |
|
|
|
endif() |
|
|
|
elseif(EXISTS "${d}") |
|
|
|
elseif(EXISTS "${d}") |
|
|
|
ocv_target_include_directories(${target} "${d}") |
|
|
|
ocv_target_include_directories(${target} "${d}") |
|
|
|
|
|
|
|
else() |
|
|
|
|
|
|
|
message(WARNING "Unexpected include: ${d} (module=${the_module})") |
|
|
|
endif() |
|
|
|
endif() |
|
|
|
endforeach() |
|
|
|
endforeach() |
|
|
|
endmacro() |
|
|
|
endmacro() |
|
|
@ -686,14 +688,7 @@ macro(ocv_module_include_directories) |
|
|
|
"${OPENCV_MODULE_${the_module}_LOCATION}/src" |
|
|
|
"${OPENCV_MODULE_${the_module}_LOCATION}/src" |
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}" # for precompiled headers |
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}" # for precompiled headers |
|
|
|
) |
|
|
|
) |
|
|
|
foreach(arg ${ARGN}) |
|
|
|
ocv_target_include_modules(${the_module} ${OPENCV_MODULE_${the_module}_DEPS} ${ARGN}) |
|
|
|
if(IS_ABSOLUTE "${arg}") |
|
|
|
|
|
|
|
list(APPEND incs "${arg}") |
|
|
|
|
|
|
|
else() |
|
|
|
|
|
|
|
list(APPEND incs "${OPENCV_MODULE_${the_module}_LOCATION}/${arg}") |
|
|
|
|
|
|
|
endif() |
|
|
|
|
|
|
|
endforeach() |
|
|
|
|
|
|
|
ocv_target_include_modules(${the_module} ${OPENCV_MODULE_${the_module}_DEPS} ${incs}) |
|
|
|
|
|
|
|
endmacro() |
|
|
|
endmacro() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|