Merge pull request #5195 from mshabunin:warn-missing-contrib

This commit is contained in:
Alexander Alekhin 2015-08-20 12:36:00 +00:00
commit 3afe8832c5

View File

@ -248,7 +248,7 @@ macro(ocv_glob_modules)
foreach(__path ${ARGN})
if("${__path}" STREQUAL "EXTRA")
set(OPENCV_PROCESSING_EXTRA_MODULES 1)
endif()
else()
get_filename_component(__path "${__path}" ABSOLUTE)
list(FIND __directories_observed "${__path}" __pathIdx)
@ -257,6 +257,7 @@ macro(ocv_glob_modules)
endif()
list(APPEND __directories_observed "${__path}")
set(__count 0)
file(GLOB __ocvmodules RELATIVE "${__path}" "${__path}/*")
if(__ocvmodules)
list(SORT __ocvmodules)
@ -271,9 +272,17 @@ macro(ocv_glob_modules)
list(APPEND __directories_observed "${__modpath}")
add_subdirectory("${__modpath}" "${CMAKE_CURRENT_BINARY_DIR}/${mod}/.${mod}")
if (DEFINED OPENCV_MODULE_opencv_${mod}_LOCATION)
math(EXPR __count "${__count} + 1")
endif()
endif()
endforeach()
endif()
if (OPENCV_PROCESSING_EXTRA_MODULES AND ${__count} LESS 1)
message(SEND_ERROR "No extra modules found in folder: ${__path}\nPlease provide path to 'opencv_contrib/modules' folder.")
endif()
endif()
endforeach()
ocv_clear_vars(__ocvmodules __directories_observed __path __modpath __pathIdx)