Merge pull request #3039 from alalek:ocv_world

pull/3047/head^2
Vadim Pisarevsky 10 years ago
commit ca183707f2
  1. 4
      CMakeLists.txt
  2. 10
      apps/traincascade/CMakeLists.txt
  3. 7
      cmake/OpenCVDetectAndroidSDK.cmake
  4. 364
      cmake/OpenCVModule.cmake
  5. 12
      cmake/OpenCVPCHSupport.cmake
  6. 104
      cmake/OpenCVUtils.cmake
  7. 37
      cmake/templates/OpenCVConfig.cmake.in
  8. 2
      modules/CMakeLists.txt
  9. 2
      modules/androidcamera/camera_wrapper/CMakeLists.txt
  10. 2
      modules/calib3d/perf/opencl/perf_stereobm.cpp
  11. 1
      modules/calib3d/src/circlesgrid.cpp
  12. 2
      modules/calib3d/src/stereobm.cpp
  13. 2
      modules/calib3d/test/opencl/test_stereobm.cpp
  14. 5
      modules/core/CMakeLists.txt
  15. 2
      modules/core/perf/opencl/perf_arithm.cpp
  16. 2
      modules/core/perf/opencl/perf_bufferpool.cpp
  17. 2
      modules/core/perf/opencl/perf_channels.cpp
  18. 2
      modules/core/perf/opencl/perf_dxt.cpp
  19. 2
      modules/core/perf/opencl/perf_gemm.cpp
  20. 2
      modules/core/perf/opencl/perf_matop.cpp
  21. 2
      modules/core/perf/opencl/perf_usage_flags.cpp
  22. 2
      modules/core/src/arithm.cpp
  23. 2
      modules/core/src/convert.cpp
  24. 2
      modules/core/src/copy.cpp
  25. 2
      modules/core/src/dxt.cpp
  26. 2
      modules/core/src/mathfuncs.cpp
  27. 2
      modules/core/src/matmul.cpp
  28. 2
      modules/core/src/matrix.cpp
  29. 2
      modules/core/src/opencl/runtime/opencl_clamdblas.cpp
  30. 2
      modules/core/src/opencl/runtime/opencl_clamdfft.cpp
  31. 2
      modules/core/src/opencl/runtime/opencl_core.cpp
  32. 2
      modules/core/src/stat.cpp
  33. 2
      modules/core/src/umatrix.cpp
  34. 2
      modules/core/test/ocl/test_arithm.cpp
  35. 2
      modules/core/test/ocl/test_channels.cpp
  36. 2
      modules/core/test/ocl/test_dft.cpp
  37. 2
      modules/core/test/ocl/test_gemm.cpp
  38. 2
      modules/core/test/ocl/test_matrix_expr.cpp
  39. 2
      modules/core/test/ocl/test_matrix_operation.cpp
  40. 2
      modules/cudaarithm/CMakeLists.txt
  41. 2
      modules/cudacodec/CMakeLists.txt
  42. 2
      modules/cudev/test/CMakeLists.txt
  43. 2
      modules/features2d/perf/opencl/perf_brute_force_matcher.cpp
  44. 2
      modules/features2d/perf/opencl/perf_fast.cpp
  45. 2
      modules/features2d/perf/opencl/perf_orb.cpp
  46. 2
      modules/features2d/src/fast.cpp
  47. 2
      modules/features2d/src/kaze/AKAZEConfig.h
  48. 2
      modules/features2d/src/kaze/AKAZEFeatures.h
  49. 2
      modules/features2d/src/kaze/KAZEConfig.h
  50. 2
      modules/features2d/src/kaze/fed.cpp
  51. 2
      modules/features2d/src/kaze/nldiffusion_functions.h
  52. 2
      modules/features2d/src/matchers.cpp
  53. 2
      modules/features2d/src/orb.cpp
  54. 2
      modules/features2d/test/ocl/test_brute_force_matcher.cpp
  55. 43
      modules/highgui/CMakeLists.txt
  56. 35
      modules/imgcodecs/CMakeLists.txt
  57. 2
      modules/imgproc/perf/opencl/perf_3vs4.cpp
  58. 2
      modules/imgproc/perf/opencl/perf_accumulate.cpp
  59. 2
      modules/imgproc/perf/opencl/perf_blend.cpp
  60. 2
      modules/imgproc/perf/opencl/perf_color.cpp
  61. 2
      modules/imgproc/perf/opencl/perf_filters.cpp
  62. 2
      modules/imgproc/perf/opencl/perf_gftt.cpp
  63. 2
      modules/imgproc/perf/opencl/perf_imgproc.cpp
  64. 2
      modules/imgproc/perf/opencl/perf_imgwarp.cpp
  65. 2
      modules/imgproc/perf/opencl/perf_matchTemplate.cpp
  66. 2
      modules/imgproc/perf/opencl/perf_moments.cpp
  67. 2
      modules/imgproc/perf/opencl/perf_pyramid.cpp
  68. 2
      modules/imgproc/src/accum.cpp
  69. 2
      modules/imgproc/src/blend.cpp
  70. 2
      modules/imgproc/src/canny.cpp
  71. 2
      modules/imgproc/src/clahe.cpp
  72. 2
      modules/imgproc/src/color.cpp
  73. 2
      modules/imgproc/src/corner.cpp
  74. 2
      modules/imgproc/src/deriv.cpp
  75. 2
      modules/imgproc/src/featureselect.cpp
  76. 2
      modules/imgproc/src/filter.cpp
  77. 2
      modules/imgproc/src/histogram.cpp
  78. 2
      modules/imgproc/src/imgwarp.cpp
  79. 2
      modules/imgproc/src/moments.cpp
  80. 2
      modules/imgproc/src/morph.cpp
  81. 2
      modules/imgproc/src/pyramids.cpp
  82. 2
      modules/imgproc/src/smooth.cpp
  83. 2
      modules/imgproc/src/sumpixels.cpp
  84. 2
      modules/imgproc/src/templmatch.cpp
  85. 2
      modules/imgproc/src/thresh.cpp
  86. 2
      modules/imgproc/test/ocl/test_accumulate.cpp
  87. 2
      modules/imgproc/test/ocl/test_blend.cpp
  88. 2
      modules/imgproc/test/ocl/test_boxfilter.cpp
  89. 2
      modules/imgproc/test/ocl/test_canny.cpp
  90. 2
      modules/imgproc/test/ocl/test_color.cpp
  91. 2
      modules/imgproc/test/ocl/test_filter2d.cpp
  92. 2
      modules/imgproc/test/ocl/test_filters.cpp
  93. 2
      modules/imgproc/test/ocl/test_gftt.cpp
  94. 2
      modules/imgproc/test/ocl/test_histogram.cpp
  95. 2
      modules/imgproc/test/ocl/test_imgproc.cpp
  96. 2
      modules/imgproc/test/ocl/test_match_template.cpp
  97. 2
      modules/imgproc/test/ocl/test_medianfilter.cpp
  98. 2
      modules/imgproc/test/ocl/test_pyramids.cpp
  99. 2
      modules/imgproc/test/ocl/test_sepfilter2D.cpp
  100. 2
      modules/imgproc/test/ocl/test_warp.cpp
  101. Some files were not shown because too many files have changed in this diff Show More

@ -337,6 +337,9 @@ if(DEFINED CMAKE_DEBUG_POSTFIX)
set(OPENCV_DEBUG_POSTFIX "${CMAKE_DEBUG_POSTFIX}")
endif()
if(INSTALL_CREATE_DISTRIB AND BUILD_SHARED_LIBS AND NOT DEFINED BUILD_opencv_world)
set(BUILD_opencv_world ON CACHE INTERNAL "")
endif()
# ----------------------------------------------------------------------------
# Path for build/platform -specific headers
@ -554,7 +557,6 @@ endif()
# ----------------------------------------------------------------------------
# Finalization: generate configuration-based files
# ----------------------------------------------------------------------------
ocv_track_build_dependencies()
# Generate platform-dependent and configuration-dependent headers
include(cmake/OpenCVGenHeaders.cmake)

@ -6,18 +6,18 @@ if(NOT OCV_DEPENDENCIES_FOUND)
endif()
project(traincascade)
set(the_target opencv_traincascade)
ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}" "${OpenCV_SOURCE_DIR}/include/opencv")
ocv_include_modules(${OPENCV_TRAINCASCADE_DEPS})
ocv_target_include_directories(${the_target} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}" "${OpenCV_SOURCE_DIR}/include/opencv")
ocv_target_include_modules(${the_target} ${OPENCV_TRAINCASCADE_DEPS})
file(GLOB SRCS *.cpp)
file(GLOB HDRS *.h*)
set(traincascade_files ${SRCS} ${HDRS})
set(the_target opencv_traincascade)
add_executable(${the_target} ${traincascade_files})
target_link_libraries(${the_target} ${OPENCV_TRAINCASCADE_DEPS})
ocv_add_executable(${the_target} ${traincascade_files})
ocv_target_link_libraries(${the_target} ${OPENCV_TRAINCASCADE_DEPS})
set_target_properties(${the_target} PROPERTIES
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"

@ -280,9 +280,6 @@ macro(add_android_project target path)
string(REGEX REPLACE "LOCAL_MODULE[ ]*:=[ ]*([a-zA-Z_][a-zA-Z_0-9]*)[ ]*" "\\1" JNI_LIB_NAME "${JNI_LIB_NAME}")
if(JNI_LIB_NAME)
ocv_include_modules_recurse(${android_proj_NATIVE_DEPS})
ocv_include_directories("${path}/jni")
if(NATIVE_APP_GLUE)
include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
list(APPEND android_proj_jni_files ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
@ -291,7 +288,9 @@ macro(add_android_project target path)
endif()
add_library(${JNI_LIB_NAME} MODULE ${android_proj_jni_files})
target_link_libraries(${JNI_LIB_NAME} ${OPENCV_LINKER_LIBS} ${android_proj_NATIVE_DEPS})
ocv_target_include_modules_recurse(${JNI_LIB_NAME} ${android_proj_NATIVE_DEPS})
ocv_target_include_directories(${JNI_LIB_NAME} "${path}/jni")
ocv_target_link_libraries(${JNI_LIB_NAME} ${OPENCV_LINKER_LIBS} ${android_proj_NATIVE_DEPS})
set_target_properties(${JNI_LIB_NAME} PROPERTIES
OUTPUT_NAME "${JNI_LIB_NAME}"

@ -6,16 +6,19 @@
# Global variables:
#
# OPENCV_MODULE_${the_module}_LOCATION
# OPENCV_MODULE_${the_module}_BINARY_DIR
# OPENCV_MODULE_${the_module}_DESCRIPTION
# OPENCV_MODULE_${the_module}_CLASS - PUBLIC|INTERNAL|BINDINGS
# OPENCV_MODULE_${the_module}_HEADERS
# OPENCV_MODULE_${the_module}_SOURCES
# OPENCV_MODULE_${the_module}_DEPS - final flattened set of module dependencies
# OPENCV_MODULE_${the_module}_DEPS_TO_LINK - differs from above for world build only
# OPENCV_MODULE_${the_module}_DEPS_EXT - non-module dependencies
# OPENCV_MODULE_${the_module}_REQ_DEPS
# OPENCV_MODULE_${the_module}_OPT_DEPS
# OPENCV_MODULE_${the_module}_PRIVATE_REQ_DEPS
# OPENCV_MODULE_${the_module}_PRIVATE_OPT_DEPS
# OPENCV_MODULE_${the_module}_IS_PART_OF_WORLD
# HAVE_${the_module} - for fast check of module availability
# To control the setup of the module you could also set:
@ -53,6 +56,7 @@ foreach(mod ${OPENCV_MODULES_BUILD} ${OPENCV_MODULES_DISABLED_USER} ${OPENCV_MOD
unset(OPENCV_MODULE_${mod}_OPT_DEPS CACHE)
unset(OPENCV_MODULE_${mod}_PRIVATE_REQ_DEPS CACHE)
unset(OPENCV_MODULE_${mod}_PRIVATE_OPT_DEPS CACHE)
unset(OPENCV_MODULE_${mod}_LINK_DEPS CACHE)
endforeach()
# clean modules info which needs to be recalculated
@ -61,6 +65,7 @@ set(OPENCV_MODULES_BUILD "" CACHE INTERNAL "List of OpenCV modules incl
set(OPENCV_MODULES_DISABLED_USER "" CACHE INTERNAL "List of OpenCV modules explicitly disabled by user")
set(OPENCV_MODULES_DISABLED_AUTO "" CACHE INTERNAL "List of OpenCV modules implicitly disabled due to dependencies")
set(OPENCV_MODULES_DISABLED_FORCE "" CACHE INTERNAL "List of OpenCV modules which can not be build in current configuration")
unset(OPENCV_WORLD_MODULES CACHE)
# adds dependencies to OpenCV module
# Usage:
@ -68,6 +73,7 @@ set(OPENCV_MODULES_DISABLED_FORCE "" CACHE INTERNAL "List of OpenCV modules whic
# Notes:
# * <list of dependencies> - can include full names of modules or full pathes to shared/static libraries or cmake targets
macro(ocv_add_dependencies full_modname)
ocv_debug_message("ocv_add_dependencies(" ${full_modname} ${ARGN} ")")
#we don't clean the dependencies here to allow this macro several times for every module
foreach(d "REQUIRED" ${ARGN})
if(d STREQUAL "REQUIRED")
@ -105,6 +111,7 @@ endmacro()
# Example:
# ocv_add_module(yaom INTERNAL opencv_core opencv_highgui opencv_flann OPTIONAL opencv_cuda)
macro(ocv_add_module _name)
ocv_debug_message("ocv_add_module(" ${_name} ${ARGN} ")")
string(TOLOWER "${_name}" name)
string(REGEX REPLACE "^opencv_" "" ${name} "${name}")
set(the_module opencv_${name})
@ -134,6 +141,8 @@ macro(ocv_add_module _name)
set(OPENCV_MODULE_${the_module}_DESCRIPTION "${the_description}" CACHE INTERNAL "Brief description of ${the_module} module")
set(OPENCV_MODULE_${the_module}_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}" CACHE INTERNAL "Location of ${the_module} module sources")
set(OPENCV_MODULE_${the_module}_LINK_DEPS "" CACHE INTERNAL "")
# parse list of dependencies
if("${ARGV1}" STREQUAL "INTERNAL" OR "${ARGV1}" STREQUAL "BINDINGS")
set(OPENCV_MODULE_${the_module}_CLASS "${ARGV1}" CACHE INTERNAL "The category of the module")
@ -150,8 +159,14 @@ macro(ocv_add_module _name)
endif()
# add self to the world dependencies
if(NOT DEFINED OPENCV_MODULE_IS_PART_OF_WORLD AND NOT OPENCV_MODULE_${the_module}_CLASS STREQUAL "BINDINGS" OR OPENCV_MODULE_IS_PART_OF_WORLD)
if((NOT DEFINED OPENCV_MODULE_IS_PART_OF_WORLD AND NOT OPENCV_MODULE_${the_module}_CLASS STREQUAL "BINDINGS"
AND NOT OPENCV_PROCESSING_EXTRA_MODULES)
OR OPENCV_MODULE_IS_PART_OF_WORLD
)
set(OPENCV_MODULE_${the_module}_IS_PART_OF_WORLD ON CACHE INTERNAL "")
ocv_add_dependencies(opencv_world OPTIONAL ${the_module})
else()
set(OPENCV_MODULE_${the_module}_IS_PART_OF_WORLD OFF CACHE INTERNAL "")
endif()
if(BUILD_${the_module})
@ -164,12 +179,15 @@ macro(ocv_add_module _name)
# stop processing of current file
return()
else(OPENCV_INITIAL_PASS)
else()
set(OPENCV_MODULE_${the_module}_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}" CACHE INTERNAL "")
if(NOT BUILD_${the_module})
return() # extra protection from redefinition
endif()
project(${the_module})
endif(OPENCV_INITIAL_PASS)
if((NOT OPENCV_MODULE_${the_module}_IS_PART_OF_WORLD AND NOT ${the_module} STREQUAL opencv_world) OR NOT ${BUILD_opencv_world})
project(${the_module})
endif()
endif()
endmacro()
# excludes module from current configuration
@ -200,7 +218,11 @@ macro(ocv_glob_modules)
# collect modules
set(OPENCV_INITIAL_PASS ON)
set(OPENCV_PROCESSING_EXTRA_MODULES 0)
foreach(__path ${ARGN})
if("${__path}" STREQUAL "EXTRA")
set(OPENCV_PROCESSING_EXTRA_MODULES 1)
endif()
get_filename_component(__path "${__path}" ABSOLUTE)
list(FIND __directories_observed "${__path}" __pathIdx)
@ -222,16 +244,7 @@ macro(ocv_glob_modules)
endif()
list(APPEND __directories_observed "${__modpath}")
if(OCV_MODULE_RELOCATE_ON_INITIAL_PASS)
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${mod}/.${mod}")
file(COPY "${__modpath}/CMakeLists.txt" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/${mod}/.${mod}")
add_subdirectory("${CMAKE_CURRENT_BINARY_DIR}/${mod}/.${mod}" "${CMAKE_CURRENT_BINARY_DIR}/${mod}/.${mod}")
if("${OPENCV_MODULE_opencv_${mod}_LOCATION}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}/${mod}/.${mod}")
set(OPENCV_MODULE_opencv_${mod}_LOCATION "${__modpath}" CACHE PATH "" FORCE)
endif()
else()
add_subdirectory("${__modpath}" "${CMAKE_CURRENT_BINARY_DIR}/${mod}/.${mod}")
endif()
add_subdirectory("${__modpath}" "${CMAKE_CURRENT_BINARY_DIR}/${mod}/.${mod}")
endif()
endforeach()
endif()
@ -244,15 +257,31 @@ macro(ocv_glob_modules)
# create modules
set(OPENCV_INITIAL_PASS OFF PARENT_SCOPE)
set(OPENCV_INITIAL_PASS OFF)
foreach(m ${OPENCV_MODULES_BUILD})
if(m MATCHES "^opencv_")
string(REGEX REPLACE "^opencv_" "" __shortname "${m}")
add_subdirectory("${OPENCV_MODULE_${m}_LOCATION}" "${CMAKE_CURRENT_BINARY_DIR}/${__shortname}")
else()
message(WARNING "Check module name: ${m}")
add_subdirectory("${OPENCV_MODULE_${m}_LOCATION}" "${CMAKE_CURRENT_BINARY_DIR}/${m}")
endif()
endforeach()
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)
message(STATUS "Processing module ${m}...")
if(m MATCHES "^opencv_")
string(REGEX REPLACE "^opencv_" "" __shortname "${m}")
add_subdirectory("${OPENCV_MODULE_${m}_LOCATION}" "${CMAKE_CURRENT_BINARY_DIR}/${__shortname}")
else()
message(WARNING "Check module name: ${m}")
add_subdirectory("${OPENCV_MODULE_${m}_LOCATION}" "${CMAKE_CURRENT_BINARY_DIR}/${m}")
endif()
endif()
endforeach()
else()
foreach(m ${OPENCV_MODULES_BUILD})
if(m MATCHES "^opencv_")
string(REGEX REPLACE "^opencv_" "" __shortname "${m}")
add_subdirectory("${OPENCV_MODULE_${m}_LOCATION}" "${CMAKE_CURRENT_BINARY_DIR}/${__shortname}")
else()
message(WARNING "Check module name: ${m}")
add_subdirectory("${OPENCV_MODULE_${m}_LOCATION}" "${CMAKE_CURRENT_BINARY_DIR}/${m}")
endif()
endforeach()
endif()
unset(__shortname)
endmacro()
@ -394,11 +423,36 @@ function(__ocv_resolve_dependencies)
__ocv_sort_modules_by_deps(OPENCV_MODULE_${m}_DEPS)
ocv_list_sort(OPENCV_MODULE_${m}_DEPS_EXT)
set(LINK_DEPS ${OPENCV_MODULE_${m}_DEPS})
# process world
if(BUILD_opencv_world)
if(OPENCV_MODULE_${m}_IS_PART_OF_WORLD)
list(APPEND OPENCV_WORLD_MODULES ${m})
endif()
foreach(m2 ${OPENCV_MODULES_BUILD})
if(OPENCV_MODULE_${m2}_IS_PART_OF_WORLD)
if(";${LINK_DEPS};" MATCHES ";${m2};")
list(REMOVE_ITEM LINK_DEPS ${m2})
if(NOT (";${LINK_DEPS};" MATCHES ";opencv_world;") AND NOT (${m} STREQUAL opencv_world))
list(APPEND LINK_DEPS opencv_world)
endif()
endif()
if(${m} STREQUAL opencv_world)
list(APPEND OPENCV_MODULE_opencv_world_DEPS_EXT ${OPENCV_MODULE_${m2}_DEPS_EXT})
endif()
endif()
endforeach()
endif()
set(OPENCV_MODULE_${m}_DEPS ${OPENCV_MODULE_${m}_DEPS} CACHE INTERNAL "Flattened dependencies of ${m} module")
set(OPENCV_MODULE_${m}_DEPS_EXT ${OPENCV_MODULE_${m}_DEPS_EXT} CACHE INTERNAL "Extra dependencies of ${m} module")
set(OPENCV_MODULE_${m}_DEPS_TO_LINK ${LINK_DEPS} CACHE INTERNAL "Flattened dependencies of ${m} module (for linker)")
# message(STATUS " module deps: ${OPENCV_MODULE_${m}_DEPS}")
# message(STATUS " extra deps: ${OPENCV_MODULE_${m}_DEPS_EXT}")
# message(STATUS " module deps of ${m}: ${OPENCV_MODULE_${m}_DEPS}")
# message(STATUS " module link deps of ${m}: ${OPENCV_MODULE_${m}_DEPS_TO_LINK}")
# message(STATUS " extra deps of ${m}: ${OPENCV_MODULE_${m}_DEPS_EXT}")
# message(STATUS "")
endforeach()
__ocv_sort_modules_by_deps(OPENCV_MODULES_BUILD)
@ -406,6 +460,7 @@ function(__ocv_resolve_dependencies)
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_DISABLED_AUTO ${OPENCV_MODULES_DISABLED_AUTO} CACHE INTERNAL "List of OpenCV modules implicitly disabled due to dependencies")
set(OPENCV_WORLD_MODULES ${OPENCV_WORLD_MODULES} CACHE INTERNAL "List of OpenCV modules included into the world")
endfunction()
@ -422,18 +477,31 @@ macro(ocv_include_modules)
endforeach()
endmacro()
# setup include paths for the list of passed modules
macro(ocv_target_include_modules target)
foreach(d ${ARGN})
if(d MATCHES "^opencv_" AND HAVE_${d})
if (EXISTS "${OPENCV_MODULE_${d}_LOCATION}/include")
ocv_target_include_directories(${target} "${OPENCV_MODULE_${d}_LOCATION}/include")
endif()
elseif(EXISTS "${d}")
ocv_target_include_directories(${target} "${d}")
endif()
endforeach()
endmacro()
# setup include paths for the list of passed modules and recursively add dependent modules
macro(ocv_include_modules_recurse)
macro(ocv_target_include_modules_recurse target)
foreach(d ${ARGN})
if(d MATCHES "^opencv_" AND HAVE_${d})
if (EXISTS "${OPENCV_MODULE_${d}_LOCATION}/include")
ocv_include_directories("${OPENCV_MODULE_${d}_LOCATION}/include")
ocv_target_include_directories(${target} "${OPENCV_MODULE_${d}_LOCATION}/include")
endif()
if(OPENCV_MODULE_${d}_DEPS)
ocv_include_modules(${OPENCV_MODULE_${d}_DEPS})
ocv_target_include_modules(${target} ${OPENCV_MODULE_${d}_DEPS})
endif()
elseif(EXISTS "${d}")
ocv_include_directories("${d}")
ocv_target_include_directories(${target} "${d}")
endif()
endforeach()
endmacro()
@ -441,11 +509,12 @@ endmacro()
# setup include path for OpenCV headers for specified module
# ocv_module_include_directories(<extra include directories/extra include modules>)
macro(ocv_module_include_directories)
ocv_include_directories("${OPENCV_MODULE_${the_module}_LOCATION}/include"
"${OPENCV_MODULE_${the_module}_LOCATION}/src"
"${CMAKE_CURRENT_BINARY_DIR}" # for precompiled headers
)
ocv_include_modules(${OPENCV_MODULE_${the_module}_DEPS} ${ARGN})
ocv_target_include_directories(${the_module}
"${OPENCV_MODULE_${the_module}_LOCATION}/include"
"${OPENCV_MODULE_${the_module}_LOCATION}/src"
"${CMAKE_CURRENT_BINARY_DIR}" # for precompiled headers
)
ocv_target_include_modules(${the_module} ${OPENCV_MODULE_${the_module}_DEPS} ${ARGN})
endmacro()
@ -454,6 +523,8 @@ endmacro()
# Usage:
# ocv_set_module_sources([HEADERS] <list of files> [SOURCES] <list of files>)
macro(ocv_set_module_sources)
ocv_debug_message("ocv_set_module_sources(" ${ARGN} ")")
set(OPENCV_MODULE_${the_module}_HEADERS "")
set(OPENCV_MODULE_${the_module}_SOURCES "")
@ -481,31 +552,50 @@ endmacro()
# Usage:
# ocv_glob_module_sources([EXCLUDE_CUDA] <extra sources&headers in the same format as used in ocv_set_module_sources>)
macro(ocv_glob_module_sources)
ocv_debug_message("ocv_glob_module_sources(" ${ARGN} ")")
set(_argn ${ARGN})
list(FIND _argn "EXCLUDE_CUDA" exclude_cuda)
if(NOT exclude_cuda EQUAL -1)
list(REMOVE_AT _argn ${exclude_cuda})
endif()
file(GLOB_RECURSE lib_srcs "src/*.cpp")
file(GLOB_RECURSE lib_int_hdrs "src/*.hpp" "src/*.h")
file(GLOB lib_hdrs "include/opencv2/*.hpp" "include/opencv2/${name}/*.hpp" "include/opencv2/${name}/*.h")
file(GLOB lib_hdrs_detail "include/opencv2/${name}/detail/*.hpp" "include/opencv2/${name}/detail/*.h")
file(GLOB_RECURSE lib_srcs_apple "src/*.mm")
file(GLOB_RECURSE lib_srcs
"${CMAKE_CURRENT_LIST_DIR}/src/*.cpp"
)
file(GLOB_RECURSE lib_int_hdrs
"${CMAKE_CURRENT_LIST_DIR}/src/*.hpp"
"${CMAKE_CURRENT_LIST_DIR}/src/*.h"
)
file(GLOB lib_hdrs
"${CMAKE_CURRENT_LIST_DIR}/include/opencv2/*.hpp"
"${CMAKE_CURRENT_LIST_DIR}/include/opencv2/${name}/*.hpp"
"${CMAKE_CURRENT_LIST_DIR}/include/opencv2/${name}/*.h"
)
file(GLOB lib_hdrs_detail
"${CMAKE_CURRENT_LIST_DIR}/include/opencv2/${name}/detail/*.hpp"
"${CMAKE_CURRENT_LIST_DIR}/include/opencv2/${name}/detail/*.h"
)
if (APPLE)
file(GLOB_RECURSE lib_srcs_apple
"${CMAKE_CURRENT_LIST_DIR}/src/*.mm"
)
list(APPEND lib_srcs ${lib_srcs_apple})
endif()
ocv_source_group("Src" DIRBASE "${CMAKE_CURRENT_SOURCE_DIR}/src" FILES ${lib_srcs} ${lib_int_hdrs})
ocv_source_group("Include" DIRBASE "${CMAKE_CURRENT_SOURCE_DIR}/include" FILES ${lib_hdrs} ${lib_hdrs_detail})
ocv_source_group("Src" DIRBASE "${CMAKE_CURRENT_LIST_DIR}/src" FILES ${lib_srcs} ${lib_int_hdrs})
ocv_source_group("Include" DIRBASE "${CMAKE_CURRENT_LIST_DIR}/include" FILES ${lib_hdrs} ${lib_hdrs_detail})
if (exclude_cuda EQUAL -1)
file(GLOB lib_cuda_srcs "src/cuda/*.cu")
file(GLOB lib_cuda_srcs
"${CMAKE_CURRENT_LIST_DIR}/src/cuda/*.cu"
)
set(cuda_objs "")
set(lib_cuda_hdrs "")
if(HAVE_CUDA)
ocv_include_directories(${CUDA_INCLUDE_DIRS})
file(GLOB lib_cuda_hdrs "src/cuda/*.hpp")
file(GLOB lib_cuda_hdrs
"${CMAKE_CURRENT_LIST_DIR}/src/cuda/*.hpp"
)
ocv_cuda_compile(cuda_objs ${lib_cuda_srcs} ${lib_cuda_hdrs})
source_group("Src\\Cuda" FILES ${lib_cuda_srcs} ${lib_cuda_hdrs})
@ -516,17 +606,19 @@ macro(ocv_glob_module_sources)
set(lib_cuda_hdrs "")
endif()
file(GLOB cl_kernels "src/opencl/*.cl")
file(GLOB cl_kernels
"${CMAKE_CURRENT_LIST_DIR}/src/opencl/*.cl"
)
if(cl_kernels)
set(OCL_NAME opencl_kernels_${name})
ocv_include_directories(${OPENCL_INCLUDE_DIRS})
string(REGEX REPLACE "opencv_" "" the_module_barename "${the_module}")
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/opencl_kernels.cpp" "${CMAKE_CURRENT_BINARY_DIR}/opencl_kernels.hpp"
COMMAND ${CMAKE_COMMAND} -DMODULE_NAME="${the_module_barename}" -DCL_DIR="${CMAKE_CURRENT_SOURCE_DIR}/src/opencl" -DOUTPUT="${CMAKE_CURRENT_BINARY_DIR}/opencl_kernels.cpp" -P "${OpenCV_SOURCE_DIR}/cmake/cl2cpp.cmake"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${OCL_NAME}.cpp" "${CMAKE_CURRENT_BINARY_DIR}/${OCL_NAME}.hpp"
COMMAND ${CMAKE_COMMAND} -DMODULE_NAME="${name}" -DCL_DIR="${CMAKE_CURRENT_LIST_DIR}/src/opencl" -DOUTPUT="${CMAKE_CURRENT_BINARY_DIR}/${OCL_NAME}.cpp" -P "${OpenCV_SOURCE_DIR}/cmake/cl2cpp.cmake"
DEPENDS ${cl_kernels} "${OpenCV_SOURCE_DIR}/cmake/cl2cpp.cmake")
ocv_source_group("Src\\opencl\\kernels" FILES ${cl_kernels})
ocv_source_group("Src\\opencl\\kernels\\autogenerated" FILES "${CMAKE_CURRENT_BINARY_DIR}/opencl_kernels.cpp" "${CMAKE_CURRENT_BINARY_DIR}/opencl_kernels.hpp")
list(APPEND lib_srcs ${cl_kernels} "${CMAKE_CURRENT_BINARY_DIR}/opencl_kernels.cpp" "${CMAKE_CURRENT_BINARY_DIR}/opencl_kernels.hpp")
ocv_source_group("Src\\opencl\\kernels\\autogenerated" FILES "${CMAKE_CURRENT_BINARY_DIR}/${OCL_NAME}.cpp" "${CMAKE_CURRENT_BINARY_DIR}/${OCL_NAME}.hpp")
list(APPEND lib_srcs ${cl_kernels} "${CMAKE_CURRENT_BINARY_DIR}/${OCL_NAME}.cpp" "${CMAKE_CURRENT_BINARY_DIR}/${OCL_NAME}.hpp")
endif()
ocv_set_module_sources(${_argn} HEADERS ${lib_hdrs} ${lib_hdrs_detail}
@ -537,29 +629,39 @@ endmacro()
# creates new target, configures standard dependencies, compilers flags, install rules
# Usage:
# ocv_create_module(<extra link dependencies>)
# ocv_create_module(SKIP_LINK)
# ocv_create_module()
macro(ocv_create_module)
ocv_debug_message("ocv_create_module(" ${ARGN} ")")
set(OPENCV_MODULE_${the_module}_LINK_DEPS "${OPENCV_MODULE_${the_module}_LINK_DEPS};${ARGN}" CACHE INTERNAL "")
if(${BUILD_opencv_world} AND OPENCV_MODULE_${the_module}_IS_PART_OF_WORLD)
# nothing
set(the_module_target opencv_world)
else()
_ocv_create_module(${ARGN})
set(the_module_target ${the_module})
endif()
endmacro()
macro(_ocv_create_module)
# The condition we ought to be testing here is whether ocv_add_precompiled_headers will
# be called at some point in the future. We can't look into the future, though,
# so this will have to do.
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/precomp.hpp")
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/precomp.hpp" AND NOT ${the_module} STREQUAL opencv_world)
get_native_precompiled_header(${the_module} precomp.hpp)
endif()
add_library(${the_module} ${OPENCV_MODULE_TYPE} ${OPENCV_MODULE_${the_module}_HEADERS} ${OPENCV_MODULE_${the_module}_SOURCES}
ocv_add_library(${the_module} ${OPENCV_MODULE_TYPE} ${OPENCV_MODULE_${the_module}_HEADERS} ${OPENCV_MODULE_${the_module}_SOURCES}
"${OPENCV_CONFIG_FILE_INCLUDE_DIR}/cvconfig.h" "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/opencv2/opencv_modules.hpp"
${${the_module}_pch})
if(NOT the_module STREQUAL opencv_ts)
set_target_properties(${the_module} PROPERTIES COMPILE_DEFINITIONS OPENCV_NOSTL)
endif()
if(NOT "${ARGN}" STREQUAL "SKIP_LINK")
target_link_libraries(${the_module} ${OPENCV_MODULE_${the_module}_DEPS})
target_link_libraries(${the_module} LINK_INTERFACE_LIBRARIES ${OPENCV_MODULE_${the_module}_DEPS})
target_link_libraries(${the_module} ${OPENCV_MODULE_${the_module}_DEPS_EXT} ${OPENCV_LINKER_LIBS} ${IPP_LIBS} ${ARGN})
if (HAVE_CUDA)
target_link_libraries(${the_module} ${CUDA_LIBRARIES} ${CUDA_npp_LIBRARY})
endif()
ocv_target_link_libraries(${the_module} ${OPENCV_MODULE_${the_module}_DEPS_TO_LINK})
ocv_target_link_libraries(${the_module} LINK_INTERFACE_LIBRARIES ${OPENCV_MODULE_${the_module}_DEPS_TO_LINK})
ocv_target_link_libraries(${the_module} ${OPENCV_MODULE_${the_module}_DEPS_EXT} ${OPENCV_LINKER_LIBS} ${IPP_LIBS} ${ARGN})
if (HAVE_CUDA)
ocv_target_link_libraries(${the_module} ${CUDA_LIBRARIES} ${CUDA_npp_LIBRARY})
endif()
add_dependencies(opencv_modules ${the_module})
@ -614,13 +716,16 @@ macro(ocv_create_module)
endif()
endforeach()
endif()
_ocv_add_precompiled_headers(${the_module})
endmacro()
# opencv precompiled headers macro (can add pch to modules and tests)
# this macro must be called after any "add_definitions" commands, otherwise precompiled headers will not work
# Usage:
# ocv_add_precompiled_headers(${the_module})
macro(ocv_add_precompiled_headers the_target)
macro(_ocv_add_precompiled_headers the_target)
ocv_debug_message("ocv_add_precompiled_headers(" ${the_target} ${ARGN} ")")
if("${the_target}" MATCHES "^opencv_test_.*$")
SET(pch_path "test/test_")
elseif("${the_target}" MATCHES "^opencv_perf_.*$")
@ -637,6 +742,7 @@ endmacro()
# Usage:
# ocv_define_module(module_name [INTERNAL] [EXCLUDE_CUDA] [REQUIRED] [<list of dependencies>] [OPTIONAL <list of optional dependencies>])
macro(ocv_define_module module_name)
ocv_debug_message("ocv_define_module(" ${module_name} ${ARGN} ")")
set(_argn ${ARGN})
set(exclude_cuda "")
foreach(arg ${_argn})
@ -647,10 +753,9 @@ macro(ocv_define_module module_name)
endforeach()
ocv_add_module(${module_name} ${_argn})
ocv_module_include_directories()
ocv_glob_module_sources(${exclude_cuda})
ocv_module_include_directories()
ocv_create_module()
ocv_add_precompiled_headers(${the_module})
ocv_add_accuracy_tests()
ocv_add_perf_tests()
@ -685,7 +790,7 @@ macro(__ocv_parse_test_sources tests_type)
set(__file_group_name "")
set(__file_group_sources "")
elseif(arg STREQUAL "DEPENDS_ON")
set(__currentvar "OPENCV_TEST_${the_module}_DEPS")
set(__currentvar "OPENCV_${tests_type}_${the_module}_DEPS")
elseif("${__currentvar}" STREQUAL "__file_group_sources" AND NOT __file_group_name)
set(__file_group_name "${arg}")
else()
@ -700,20 +805,20 @@ endmacro()
# this is a command for adding OpenCV performance tests to the module
# ocv_add_perf_tests(<extra_dependencies>)
function(ocv_add_perf_tests)
set(perf_path "${CMAKE_CURRENT_SOURCE_DIR}/perf")
ocv_debug_message("ocv_add_perf_tests(" ${ARGN} ")")
set(perf_path "${CMAKE_CURRENT_LIST_DIR}/perf")
if(BUILD_PERF_TESTS AND EXISTS "${perf_path}")
__ocv_parse_test_sources(PERF ${ARGN})
# opencv_imgcodecs is required for imread/imwrite
set(perf_deps ${the_module} opencv_ts opencv_imgcodecs ${OPENCV_PERF_${the_module}_DEPS} ${OPENCV_MODULE_opencv_ts_DEPS})
set(perf_deps ${the_module} opencv_ts opencv_imgcodecs ${OPENCV_MODULE_${the_module}_DEPS} ${OPENCV_MODULE_opencv_ts_DEPS})
ocv_check_dependencies(${perf_deps})
if(OCV_DEPENDENCIES_FOUND)
set(the_target "opencv_perf_${name}")
# project(${the_target})
ocv_module_include_directories(${perf_deps} "${perf_path}")
if(NOT OPENCV_PERF_${the_module}_SOURCES)
file(GLOB_RECURSE perf_srcs "${perf_path}/*.cpp")
file(GLOB_RECURSE perf_hdrs "${perf_path}/*.hpp" "${perf_path}/*.h")
@ -722,10 +827,13 @@ function(ocv_add_perf_tests)
set(OPENCV_PERF_${the_module}_SOURCES ${perf_srcs} ${perf_hdrs})
endif()
get_native_precompiled_header(${the_target} perf_precomp.hpp)
if(NOT BUILD_opencv_world)
get_native_precompiled_header(${the_target} perf_precomp.hpp)
endif()
add_executable(${the_target} ${OPENCV_PERF_${the_module}_SOURCES} ${${the_target}_pch})
target_link_libraries(${the_target} ${OPENCV_MODULE_${the_module}_DEPS} ${perf_deps} ${OPENCV_LINKER_LIBS})
ocv_add_executable(${the_target} ${OPENCV_PERF_${the_module}_SOURCES} ${${the_target}_pch})
ocv_target_include_modules(${the_target} ${perf_deps} "${perf_path}")
ocv_target_link_libraries(${the_target} ${OPENCV_MODULE_${the_module}_DEPS} ${perf_deps} ${OPENCV_LINKER_LIBS})
add_dependencies(opencv_perf_tests ${the_target})
# Additional target properties
@ -738,8 +846,9 @@ function(ocv_add_perf_tests)
set_target_properties(${the_target} PROPERTIES FOLDER "tests performance")
endif()
ocv_add_precompiled_headers(${the_target})
if(NOT BUILD_opencv_world)
_ocv_add_precompiled_headers(${the_target})
endif()
else(OCV_DEPENDENCIES_FOUND)
# TODO: warn about unsatisfied dependencies
endif(OCV_DEPENDENCIES_FOUND)
@ -752,21 +861,19 @@ endfunction()
# this is a command for adding OpenCV accuracy/regression tests to the module
# ocv_add_accuracy_tests([FILES <source group name> <list of sources>] [DEPENDS_ON] <list of extra dependencies>)
function(ocv_add_accuracy_tests)
set(test_path "${CMAKE_CURRENT_SOURCE_DIR}/test")
ocv_check_dependencies(${test_deps})
ocv_debug_message("ocv_add_accuracy_tests(" ${ARGN} ")")
set(test_path "${CMAKE_CURRENT_LIST_DIR}/test")
if(BUILD_TESTS AND EXISTS "${test_path}")
__ocv_parse_test_sources(TEST ${ARGN})
# opencv_imgcodecs is required for imread/imwrite
set(test_deps ${the_module} opencv_ts opencv_imgcodecs opencv_videoio ${OPENCV_TEST_${the_module}_DEPS} ${OPENCV_MODULE_opencv_ts_DEPS})
set(test_deps ${the_module} opencv_ts opencv_imgcodecs opencv_videoio ${OPENCV_MODULE_${the_module}_DEPS} ${OPENCV_MODULE_opencv_ts_DEPS})
ocv_check_dependencies(${test_deps})
if(OCV_DEPENDENCIES_FOUND)
set(the_target "opencv_test_${name}")
# project(${the_target})
ocv_module_include_directories(${test_deps} "${test_path}")
if(NOT OPENCV_TEST_${the_module}_SOURCES)
file(GLOB_RECURSE test_srcs "${test_path}/*.cpp")
file(GLOB_RECURSE test_hdrs "${test_path}/*.hpp" "${test_path}/*.h")
@ -775,10 +882,13 @@ function(ocv_add_accuracy_tests)
set(OPENCV_TEST_${the_module}_SOURCES ${test_srcs} ${test_hdrs})
endif()
get_native_precompiled_header(${the_target} test_precomp.hpp)
add_executable(${the_target} ${OPENCV_TEST_${the_module}_SOURCES} ${${the_target}_pch})
if(NOT BUILD_opencv_world)
get_native_precompiled_header(${the_target} test_precomp.hpp)
endif()
target_link_libraries(${the_target} ${OPENCV_MODULE_${the_module}_DEPS} ${test_deps} ${OPENCV_LINKER_LIBS})
ocv_add_executable(${the_target} ${OPENCV_TEST_${the_module}_SOURCES} ${${the_target}_pch})
ocv_target_include_modules(${the_target} ${test_deps} "${test_path}")
ocv_target_link_libraries(${the_target} ${OPENCV_MODULE_${the_module}_DEPS} ${test_deps} ${OPENCV_LINKER_LIBS})
add_dependencies(opencv_tests ${the_target})
# Additional target properties
@ -795,7 +905,9 @@ function(ocv_add_accuracy_tests)
get_target_property(LOC ${the_target} LOCATION)
add_test(${the_target} "${LOC}")
ocv_add_precompiled_headers(${the_target})
if(NOT BUILD_opencv_world)
_ocv_add_precompiled_headers(${the_target})
endif()
else(OCV_DEPENDENCIES_FOUND)
# TODO: warn about unsatisfied dependencies
endif(OCV_DEPENDENCIES_FOUND)
@ -807,6 +919,8 @@ function(ocv_add_accuracy_tests)
endfunction()
function(ocv_add_samples)
ocv_debug_message("ocv_add_samples(" ${ARGN} ")")
set(samples_path "${CMAKE_CURRENT_SOURCE_DIR}/samples")
string(REGEX REPLACE "^opencv_" "" module_id ${the_module})
@ -816,15 +930,14 @@ function(ocv_add_samples)
if(OCV_DEPENDENCIES_FOUND)
file(GLOB sample_sources "${samples_path}/*.cpp")
ocv_include_modules(${OPENCV_MODULE_${the_module}_DEPS})
foreach(source ${sample_sources})
get_filename_component(name "${source}" NAME_WE)
set(the_target "example_${module_id}_${name}")
add_executable(${the_target} "${source}")
target_link_libraries(${the_target} ${samples_deps})
ocv_add_executable(${the_target} "${source}")
ocv_target_include_modules(${the_target} ${samples_deps})
ocv_target_link_libraries(${the_target} ${samples_deps})
set_target_properties(${the_target} PROPERTIES PROJECT_LABEL "(sample) ${name}")
if(ENABLE_SOLUTION_FOLDERS)
@ -847,82 +960,3 @@ function(ocv_add_samples)
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ COMPONENT samples)
endif()
endfunction()
# internal macro; finds all link dependencies of the module
# should be used at the end of CMake processing
macro(__ocv_track_module_link_dependencies the_module optkind)
set(${the_module}_MODULE_DEPS_${optkind} "")
set(${the_module}_EXTRA_DEPS_${optkind} "")
get_target_property(__module_type ${the_module} TYPE)
if(__module_type STREQUAL "STATIC_LIBRARY")
#in case of static library we have to inherit its dependencies (in right order!!!)
if(NOT DEFINED ${the_module}_LIB_DEPENDS_${optkind})
ocv_split_libs_list(${the_module}_LIB_DEPENDS ${the_module}_LIB_DEPENDS_DBG ${the_module}_LIB_DEPENDS_OPT)
endif()
set(__resolved_deps "")
set(__mod_depends ${${the_module}_LIB_DEPENDS_${optkind}})
set(__has_cycle FALSE)
while(__mod_depends)
list(GET __mod_depends 0 __dep)
list(REMOVE_AT __mod_depends 0)
if(__dep STREQUAL the_module)
set(__has_cycle TRUE)
else()#if("${OPENCV_MODULES_BUILD}" MATCHES "(^|;)${__dep}(;|$)")
ocv_regex_escape(__rdep "${__dep}")
if(__resolved_deps MATCHES "(^|;)${__rdep}(;|$)")
#all dependencies of this module are already resolved
list(APPEND ${the_module}_MODULE_DEPS_${optkind} "${__dep}")
else()
get_target_property(__module_type ${__dep} TYPE)
if(__module_type STREQUAL "STATIC_LIBRARY")
if(NOT DEFINED ${__dep}_LIB_DEPENDS_${optkind})
ocv_split_libs_list(${__dep}_LIB_DEPENDS ${__dep}_LIB_DEPENDS_DBG ${__dep}_LIB_DEPENDS_OPT)
endif()
list(INSERT __mod_depends 0 ${${__dep}_LIB_DEPENDS_${optkind}} ${__dep})
list(APPEND __resolved_deps "${__dep}")
elseif(NOT __module_type)
list(APPEND ${the_module}_EXTRA_DEPS_${optkind} "${__dep}")
endif()
endif()
#else()
# get_target_property(__dep_location "${__dep}" LOCATION)
endif()
endwhile()
ocv_list_unique(${the_module}_MODULE_DEPS_${optkind})
#ocv_list_reverse(${the_module}_MODULE_DEPS_${optkind})
ocv_list_unique(${the_module}_EXTRA_DEPS_${optkind})
#ocv_list_reverse(${the_module}_EXTRA_DEPS_${optkind})
if(__has_cycle)
# not sure if it can work
list(APPEND ${the_module}_MODULE_DEPS_${optkind} "${the_module}")
endif()
unset(__dep_location)
unset(__mod_depends)
unset(__resolved_deps)
unset(__has_cycle)
unset(__rdep)
endif()#STATIC_LIBRARY
unset(__module_type)
#message("${the_module}_MODULE_DEPS_${optkind}")
#message(" ${${the_module}_MODULE_DEPS_${optkind}}")
#message(" ${OPENCV_MODULE_${the_module}_DEPS}")
#message("")
#message("${the_module}_EXTRA_DEPS_${optkind}")
#message(" ${${the_module}_EXTRA_DEPS_${optkind}}")
#message("")
endmacro()
# creates lists of build dependencies needed for external projects
macro(ocv_track_build_dependencies)
foreach(m ${OPENCV_MODULES_BUILD})
__ocv_track_module_link_dependencies("${m}" OPT)
__ocv_track_module_link_dependencies("${m}" DBG)
endforeach()
endmacro()

@ -68,6 +68,15 @@ MACRO(_PCH_GET_COMPILE_FLAGS _out_compile_flags)
endif()
ENDFOREACH(item)
get_target_property(DIRINC ${_PCH_current_target} INCLUDE_DIRECTORIES )
FOREACH(item ${DIRINC})
if(item MATCHES "^${OpenCV_SOURCE_DIR}/modules/")
LIST(APPEND ${_out_compile_flags} "${_PCH_include_prefix}\"${item}\"")
else()
LIST(APPEND ${_out_compile_flags} "${_PCH_isystem_prefix}\"${item}\"")
endif()
ENDFOREACH(item)
GET_DIRECTORY_PROPERTY(_directory_flags DEFINITIONS)
GET_DIRECTORY_PROPERTY(_global_definitions DIRECTORY ${OpenCV_SOURCE_DIR} DEFINITIONS)
#MESSAGE("_directory_flags ${_directory_flags} ${_global_definitions}" )
@ -254,6 +263,9 @@ MACRO(ADD_PRECOMPILED_HEADER _targetName _input)
endif()
endif()
get_target_property(DIRINC ${_targetName} INCLUDE_DIRECTORIES)
set_target_properties(${_targetName}_pch_dephelp PROPERTIES INCLUDE_DIRECTORIES "${DIRINC}")
#MESSAGE("_compile_FLAGS: ${_compile_FLAGS}")
#message("COMMAND ${CMAKE_CXX_COMPILER} ${_compile_FLAGS} -x c++-header -o ${_output} ${_input}")

@ -42,6 +42,11 @@ macro(ocv_assert)
endif()
endmacro()
macro(ocv_debug_message)
# string(REPLACE ";" " " __msg "${ARGN}")
# message(STATUS "${__msg}")
endmacro()
macro(ocv_check_environment_variables)
foreach(_var ${ARGN})
if(NOT DEFINED ${_var} AND DEFINED ENV{${_var}})
@ -53,8 +58,18 @@ macro(ocv_check_environment_variables)
endforeach()
endmacro()
# rename modules target to world if needed
macro(_ocv_fix_target target_var)
if(BUILD_opencv_world)
if(OPENCV_MODULE_${${target_var}}_IS_PART_OF_WORLD)
set(${target_var} opencv_world)
endif()
endif()
endmacro()
# adds include directories in such way that directories from the OpenCV source tree go first
function(ocv_include_directories)
ocv_debug_message("ocv_include_directories( ${ARGN} )")
set(__add_before "")
foreach(dir ${ARGN})
get_filename_component(__abs_dir "${dir}" ABSOLUTE)
@ -67,6 +82,30 @@ function(ocv_include_directories)
include_directories(BEFORE ${__add_before})
endfunction()
# adds include directories in such way that directories from the OpenCV source tree go first
function(ocv_target_include_directories target)
_ocv_fix_target(target)
set(__params "")
foreach(dir ${ARGN})
get_filename_component(__abs_dir "${dir}" ABSOLUTE)
if("${__abs_dir}" MATCHES "^${OpenCV_SOURCE_DIR}" OR "${__abs_dir}" MATCHES "^${OpenCV_BINARY_DIR}")
list(APPEND __params "${__abs_dir}")
else()
list(APPEND __params "${dir}")
endif()
endforeach()
if(CMAKE_VERSION VERSION_LESS 2.8.11)
include_directories(${__params})
else()
if(TARGET ${target})
target_include_directories(${target} PRIVATE ${__params})
else()
set(__new_inc "${OCV_TARGET_INCLUDE_DIRS_${target}};${__params}")
set(OCV_TARGET_INCLUDE_DIRS_${target} "${__new_inc}" CACHE INTERNAL "")
endif()
endif()
endfunction()
# clears all passed variables
macro(ocv_clear_vars)
foreach(_var ${ARGN})
@ -295,8 +334,8 @@ endfunction()
macro(ocv_finalize_status)
if(NOT OPENCV_SKIP_STATUS_FINALIZATION)
if(TARGET opencv_core)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${OPENCV_BUILD_INFO_FILE}" "${opencv_core_BINARY_DIR}/version_string.inc" OUTPUT_QUIET)
if(DEFINED OPENCV_MODULE_opencv_core_BINARY_DIR)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${OPENCV_BUILD_INFO_FILE}" "${OPENCV_MODULE_opencv_core_BINARY_DIR}/version_string.inc" OUTPUT_QUIET)
endif()
endif()
endmacro()
@ -533,16 +572,20 @@ function(ocv_install_target)
# message(STATUS "Process ${__target} dst=${__dst}...")
if(DEFINED __dst)
get_target_property(fname ${__target} LOCATION_DEBUG)
if(fname MATCHES "\\.lib$")
string(REGEX REPLACE "\\.lib$" ".pdb" fname "${fname}")
install(FILES ${fname} DESTINATION ${__dst} CONFIGURATIONS Debug)
endif()
if(CMAKE_VERSION VERSION_LESS 2.8.12)
get_target_property(fname ${__target} LOCATION_DEBUG)
if(fname MATCHES "\\.lib$")
string(REGEX REPLACE "\\.lib$" ".pdb" fname "${fname}")
install(FILES ${fname} DESTINATION ${__dst} CONFIGURATIONS Debug)
endif()
get_target_property(fname ${__target} LOCATION_RELEASE)
if(fname MATCHES "\\.lib$")
string(REGEX REPLACE "\\.lib$" ".pdb" fname "${fname}")
install(FILES ${fname} DESTINATION ${__dst} CONFIGURATIONS Release)
get_target_property(fname ${__target} LOCATION_RELEASE)
if(fname MATCHES "\\.lib$")
string(REGEX REPLACE "\\.lib$" ".pdb" fname "${fname}")
install(FILES ${fname} DESTINATION ${__dst} CONFIGURATIONS Release)
endif()
else()
# CMake 2.8.12 brokes PDB support in STATIC libraries for MSVS
endif()
endif()
endif()
@ -637,6 +680,9 @@ endmacro()
################################################################################################
# short command to setup source group
function(ocv_source_group group)
if(BUILD_opencv_world AND OPENCV_MODULE_${the_module}_IS_PART_OF_WORLD)
set(group "${the_module}\\${group}")
endif()
cmake_parse_arguments(SG "" "DIRBASE" "GLOB;GLOB_RECURSE;FILES" ${ARGN})
set(files "")
if(SG_FILES)
@ -669,3 +715,39 @@ function(ocv_source_group group)
source_group(${group} FILES ${files})
endif()
endfunction()
function(ocv_target_link_libraries target)
_ocv_fix_target(target)
set(LINK_DEPS ${ARGN})
# process world
if(BUILD_opencv_world)
foreach(m ${OPENCV_MODULES_BUILD})
if(OPENCV_MODULE_${m}_IS_PART_OF_WORLD)
if(";${LINK_DEPS};" MATCHES ";${m};")
list(REMOVE_ITEM LINK_DEPS ${m})
if(NOT (";${LINK_DEPS};" MATCHES ";opencv_world;"))
list(APPEND LINK_DEPS opencv_world)
endif()
endif()
endif()
endforeach()
endif()
target_link_libraries(${target} ${LINK_DEPS})
endfunction()
function(_ocv_append_target_includes target)
if(DEFINED OCV_TARGET_INCLUDE_DIRS_${target})
target_include_directories(${target} PRIVATE ${OCV_TARGET_INCLUDE_DIRS_${target}})
unset(OCV_TARGET_INCLUDE_DIRS_${target} CACHE)
endif()
endfunction()
function(ocv_add_executable target)
add_executable(${target} ${ARGN})
_ocv_append_target_includes(${target})
endfunction()
function(ocv_add_library target)
add_library(${target} ${ARGN})
_ocv_append_target_includes(${target})
endfunction()

@ -141,6 +141,7 @@ SET(OpenCV_VERSION_STATUS "@OPENCV_VERSION_STATUS@")
# ====================================================================
SET(OpenCV_LIB_COMPONENTS @OPENCV_MODULES_CONFIGCMAKE@)
SET(OpenCV_WORLD_COMPONENTS @OPENCV_WORLD_MODULES@)
# ==============================================================
# Extra include directories, needed by OpenCV 2 new structure
@ -200,8 +201,8 @@ foreach(__cvcomponent ${OpenCV_FIND_COMPONENTS})
message(WARNING "${__cvcomponent} is required but was not found")
endif()
#indicate that module is NOT found
string(TOUPPER "${__cvcomponent}" __cvcomponent)
set(${__cvcomponent}_FOUND "${__cvcomponent}_FOUND-NOTFOUND")
string(TOUPPER "${__cvcomponent}" __cvcomponentUP)
set(${__cvcomponentUP}_FOUND "${__cvcomponentUP}_FOUND-NOTFOUND")
else()
list(APPEND OpenCV_FIND_COMPONENTS_ ${__cvcomponent})
# Not using list(APPEND) here, because OpenCV_LIBS may not exist yet.
@ -209,8 +210,31 @@ foreach(__cvcomponent ${OpenCV_FIND_COMPONENTS})
# to find_package(OpenCV) with different component lists add up.
set(OpenCV_LIBS ${OpenCV_LIBS} "${__cvcomponent}")
#indicate that module is found
string(TOUPPER "${__cvcomponent}" __cvcomponent)
set(${__cvcomponent}_FOUND 1)
string(TOUPPER "${__cvcomponent}" __cvcomponentUP)
set(${__cvcomponentUP}_FOUND 1)
endif()
if(OpenCV_SHARED AND ";${OpenCV_WORLD_COMPONENTS};" MATCHES ";${__cvcomponent};" AND NOT TARGET ${__cvcomponent})
get_target_property(__implib_dbg opencv_world IMPORTED_IMPLIB_DEBUG)
get_target_property(__implib_release opencv_world IMPORTED_IMPLIB_RELEASE)
get_target_property(__location_dbg opencv_world IMPORTED_LOCATION_DEBUG)
get_target_property(__location_release opencv_world IMPORTED_LOCATION_RELEASE)
add_library(${__cvcomponent} SHARED IMPORTED)
if(__location_dbg)
set_property(TARGET ${__cvcomponent} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(${__cvcomponent} PROPERTIES
IMPORTED_IMPLIB_DEBUG "${__implib_dbg}"
IMPORTED_LINK_INTERFACE_LIBRARIES_DEBUG ""
IMPORTED_LOCATION_DEBUG "${__location_dbg}"
)
endif()
if(__location_release)
set_property(TARGET ${__cvcomponent} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(${__cvcomponent} PROPERTIES
IMPORTED_IMPLIB_RELEASE "${__implib_release}"
IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE ""
IMPORTED_LOCATION_RELEASE "${__location_release}"
)
endif()
endif()
endforeach()
set(OpenCV_FIND_COMPONENTS ${OpenCV_FIND_COMPONENTS_})
@ -321,6 +345,7 @@ macro(ocv_check_dependencies)
set(OCV_DEPENDENCIES_FOUND TRUE)
foreach(d ${ARGN})
if(NOT TARGET ${d})
message(WARNING "OpenCV: Can't resolve dependency: ${d}")
set(OCV_DEPENDENCIES_FOUND FALSE)
break()
endif()
@ -346,6 +371,10 @@ macro(ocv_include_modules)
include_directories(BEFORE "${OpenCV_INCLUDE_DIRS}")
endmacro()
macro(ocv_target_link_libraries)
target_link_libraries(${ARGN})
endmacro()
# remove all matching elements from the list
macro(ocv_list_filterout lst regex)
foreach(item ${${lst}})

@ -4,4 +4,4 @@ if(NOT OPENCV_MODULES_PATH)
set(OPENCV_MODULES_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
endif()
ocv_glob_modules(${OPENCV_MODULES_PATH} ${OPENCV_EXTRA_MODULES_PATH})
ocv_glob_modules(${OPENCV_MODULES_PATH} EXTRA ${OPENCV_EXTRA_MODULES_PATH})

@ -46,7 +46,7 @@ ADD_LIBRARY(${the_target} SHARED camera_wrapper.h camera_wrapper.cpp)
string(REGEX REPLACE "[.]" "_" LIBRARY_DEF ${ANDROID_VERSION})
add_definitions(-DANDROID_r${LIBRARY_DEF})
target_link_libraries(${the_target} c m dl utils camera_client binder log)
ocv_target_link_libraries(${the_target} c m dl utils camera_client binder log)
if(NOT ANDROID_VERSION VERSION_LESS "3.0.0")
target_link_libraries(${the_target} gui )

@ -40,7 +40,7 @@
//
//M*/
#include "perf_precomp.hpp"
#include "../perf_precomp.hpp"
#include "opencv2/ts/ocl_perf.hpp"
#ifdef HAVE_OPENCL

@ -40,6 +40,7 @@
//
//M*/
#include "precomp.hpp"
#include "circlesgrid.hpp"
#include <limits>
//#define DEBUG_CIRCLES

@ -48,7 +48,7 @@
#include "precomp.hpp"
#include <stdio.h>
#include <limits>
#include "opencl_kernels.hpp"
#include "opencl_kernels_calib3d.hpp"
namespace cv
{

@ -40,7 +40,7 @@
//
//M*/
#include "test_precomp.hpp"
#include "../test_precomp.hpp"
#include "cvconfig.h"
#include "opencv2/ts/ocl_test.hpp"

@ -1,6 +1,5 @@
set(the_description "The Core Functionality")
ocv_add_module(core PRIVATE_REQUIRED ${ZLIB_LIBRARIES} "${OPENCL_LIBRARIES}" OPTIONAL opencv_cudev)
ocv_module_include_directories(${ZLIB_INCLUDE_DIRS})
if(HAVE_WINRT_CX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /ZW")
@ -19,11 +18,11 @@ file(GLOB lib_cuda_hdrs_detail "include/opencv2/${name}/cuda/detail/*.hpp" "incl
source_group("Cuda Headers" FILES ${lib_cuda_hdrs})
source_group("Cuda Headers\\Detail" FILES ${lib_cuda_hdrs_detail})
ocv_glob_module_sources(SOURCES "${opencv_core_BINARY_DIR}/version_string.inc"
ocv_glob_module_sources(SOURCES "${OPENCV_MODULE_opencv_core_BINARY_DIR}/version_string.inc"
HEADERS ${lib_cuda_hdrs} ${lib_cuda_hdrs_detail})
ocv_module_include_directories(${the_module} ${ZLIB_INCLUDE_DIRS})
ocv_create_module()
ocv_add_precompiled_headers(${the_module})
ocv_add_accuracy_tests()
ocv_add_perf_tests()

@ -39,7 +39,7 @@
//
//M*/
#include "perf_precomp.hpp"
#include "../perf_precomp.hpp"
#include "opencv2/ts/ocl_perf.hpp"
#ifdef HAVE_OPENCL

@ -4,7 +4,7 @@
//
// Copyright (C) 2014, Advanced Micro Devices, Inc., all rights reserved.
#include "perf_precomp.hpp"
#include "../perf_precomp.hpp"
#include "opencv2/ts/ocl_perf.hpp"
#ifdef HAVE_OPENCL

@ -44,7 +44,7 @@
//
//M*/
#include "perf_precomp.hpp"
#include "../perf_precomp.hpp"
#include "opencv2/ts/ocl_perf.hpp"
#ifdef HAVE_OPENCL

@ -44,7 +44,7 @@
//
//M*/
#include "perf_precomp.hpp"
#include "../perf_precomp.hpp"
#include "opencv2/ts/ocl_perf.hpp"
#ifdef HAVE_OPENCL

@ -44,7 +44,7 @@
//
//M*/
#include "perf_precomp.hpp"
#include "../perf_precomp.hpp"
#include "opencv2/ts/ocl_perf.hpp"
#ifdef HAVE_OPENCL

@ -5,7 +5,7 @@
// Copyright (C) 2014, Advanced Micro Devices, Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
#include "perf_precomp.hpp"
#include "../perf_precomp.hpp"
#include "opencv2/ts/ocl_perf.hpp"
#ifdef HAVE_OPENCL

@ -4,7 +4,7 @@
//
// Copyright (C) 2014, Advanced Micro Devices, Inc., all rights reserved.
#include "perf_precomp.hpp"
#include "../perf_precomp.hpp"
#include "opencv2/ts/ocl_perf.hpp"
#ifdef HAVE_OPENCL

@ -47,7 +47,7 @@
// */
#include "precomp.hpp"
#include "opencl_kernels.hpp"
#include "opencl_kernels_core.hpp"
namespace cv
{

@ -41,7 +41,7 @@
//M*/
#include "precomp.hpp"
#include "opencl_kernels.hpp"
#include "opencl_kernels_core.hpp"
namespace cv
{

@ -46,7 +46,7 @@
// */
#include "precomp.hpp"
#include "opencl_kernels.hpp"
#include "opencl_kernels_core.hpp"
namespace cv
{

@ -42,7 +42,7 @@
#include "precomp.hpp"
#include "opencv2/core/opencl/runtime/opencl_clamdfft.hpp"
#include "opencv2/core/opencl/runtime/opencl_core.hpp"
#include "opencl_kernels.hpp"
#include "opencl_kernels_core.hpp"
#include <map>
namespace cv

@ -41,7 +41,7 @@
//M*/
#include "precomp.hpp"
#include "opencl_kernels.hpp"
#include "opencl_kernels_core.hpp"
namespace cv
{

@ -41,7 +41,7 @@
//M*/
#include "precomp.hpp"
#include "opencl_kernels.hpp"
#include "opencl_kernels_core.hpp"
#include "opencv2/core/opencl/runtime/opencl_clamdblas.hpp"
namespace cv

@ -41,7 +41,7 @@
//M*/
#include "precomp.hpp"
#include "opencl_kernels.hpp"
#include "opencl_kernels_core.hpp"
#include "bufferpool.impl.hpp"

@ -39,7 +39,7 @@
//
//M*/
#include "precomp.hpp"
#include "../../precomp.hpp"
#ifdef HAVE_CLAMDBLAS

@ -39,7 +39,7 @@
//
//M*/
#include "precomp.hpp"
#include "../../precomp.hpp"
#ifdef HAVE_CLAMDFFT

@ -39,7 +39,7 @@
//
//M*/
#include "precomp.hpp"
#include "../../precomp.hpp"
#if defined(HAVE_OPENCL) && !defined(HAVE_OPENCL_STATIC)

@ -44,7 +44,7 @@
#include <climits>
#include <limits>
#include "opencl_kernels.hpp"
#include "opencl_kernels_core.hpp"
namespace cv
{

@ -41,7 +41,7 @@
//M*/
#include "precomp.hpp"
#include "opencl_kernels.hpp"
#include "opencl_kernels_core.hpp"
///////////////////////////////// UMat implementation ///////////////////////////////

@ -39,7 +39,7 @@
//
//M*/
#include "test_precomp.hpp"
#include "../test_precomp.hpp"
#include "opencv2/ts/ocl_test.hpp"
#include <cmath>

@ -44,7 +44,7 @@
//
//M*/
#include "test_precomp.hpp"
#include "../test_precomp.hpp"
#include "opencv2/ts/ocl_test.hpp"
#ifdef HAVE_OPENCL

@ -43,7 +43,7 @@
//
//M*/
#include "test_precomp.hpp"
#include "../test_precomp.hpp"
#include "opencv2/ts/ocl_test.hpp"
#ifdef HAVE_OPENCL

@ -42,7 +42,7 @@
//
//M*/
#include "test_precomp.hpp"
#include "../test_precomp.hpp"
#include "opencv2/ts/ocl_test.hpp"
#ifdef HAVE_OPENCL

@ -5,7 +5,7 @@
// Copyright (C) 2014, Advanced Micro Devices, Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
#include "test_precomp.hpp"
#include "../test_precomp.hpp"
#include "opencv2/ts/ocl_test.hpp"
#ifdef HAVE_OPENCL

@ -44,7 +44,7 @@
//
//M*/
#include "test_precomp.hpp"
#include "../test_precomp.hpp"
#include "opencv2/ts/ocl_test.hpp"
#ifdef HAVE_OPENCL

@ -23,7 +23,5 @@ endif()
ocv_create_module(${extra_libs})
ocv_add_precompiled_headers(${the_module})
ocv_add_accuracy_tests(DEPENDS_ON opencv_imgproc)
ocv_add_perf_tests(DEPENDS_ON opencv_imgproc)

@ -23,7 +23,5 @@ endif()
ocv_create_module(${extra_libs})
ocv_add_precompiled_headers(${the_module})
ocv_add_accuracy_tests()
ocv_add_perf_tests()

@ -29,7 +29,7 @@ if(OCV_DEPENDENCIES_FOUND)
endforeach()
CUDA_ADD_EXECUTABLE(${the_target} ${OPENCV_TEST_${the_module}_SOURCES})
target_link_libraries(${the_target} ${test_deps} ${OPENCV_LINKER_LIBS} ${CUDA_LIBRARIES})
ocv_target_link_libraries(${the_target} ${test_deps} ${OPENCV_LINKER_LIBS} ${CUDA_LIBRARIES})
add_dependencies(opencv_tests ${the_target})
# Additional target properties

@ -43,7 +43,7 @@
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#include "perf_precomp.hpp"
#include "../perf_precomp.hpp"
#include "opencv2/ts/ocl_perf.hpp"
#ifdef HAVE_OPENCL

@ -1,4 +1,4 @@
#include "perf_precomp.hpp"
#include "../perf_precomp.hpp"
#include "opencv2/ts/ocl_perf.hpp"
#ifdef HAVE_OPENCL

@ -1,4 +1,4 @@
#include "perf_precomp.hpp"
#include "../perf_precomp.hpp"
#include "opencv2/ts/ocl_perf.hpp"
#ifdef HAVE_OPENCL

@ -43,7 +43,7 @@ The references are:
#include "precomp.hpp"
#include "fast_score.hpp"
#include "opencl_kernels.hpp"
#include "opencl_kernels_features2d.hpp"
#if defined _MSC_VER
# pragma warning( disable : 4127)

@ -10,7 +10,7 @@
/* ************************************************************************* */
// OpenCV
#include "precomp.hpp"
#include "../precomp.hpp"
#include <opencv2/features2d.hpp>
/* ************************************************************************* */

@ -11,7 +11,7 @@
/* ************************************************************************* */
// Includes
#include "precomp.hpp"
#include "../precomp.hpp"
#include "AKAZEConfig.h"
#include "TEvolution.h"

@ -9,7 +9,7 @@
#define __OPENCV_FEATURES_2D_AKAZE_CONFIG_H__
// OpenCV Includes
#include "precomp.hpp"
#include "../precomp.hpp"
#include <opencv2/features2d.hpp>
//*************************************************************************************

@ -28,7 +28,7 @@
* DAGM, 2010
*
*/
#include "precomp.hpp"
#include "../precomp.hpp"
#include "fed.h"
using namespace std;

@ -13,7 +13,7 @@
/* ************************************************************************* */
// Includes
#include "precomp.hpp"
#include "../precomp.hpp"
/* ************************************************************************* */
// Declaration of functions

@ -41,7 +41,7 @@
#include "precomp.hpp"
#include <limits>
#include "opencl_kernels.hpp"
#include "opencl_kernels_features2d.hpp"
#if defined(HAVE_EIGEN) && EIGEN_WORLD_VERSION == 2
#include <Eigen/Array>

@ -35,7 +35,7 @@
/** Authors: Ethan Rublee, Vincent Rabaud, Gary Bradski */
#include "precomp.hpp"
#include "opencl_kernels.hpp"
#include "opencl_kernels_features2d.hpp"
#include <iterator>
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

@ -48,7 +48,7 @@
//
//M*/
#include "test_precomp.hpp"
#include "../test_precomp.hpp"
#include "cvconfig.h"
#include "opencv2/ts/ocl_test.hpp"

@ -17,21 +17,27 @@ if(APPLE)
endif()
set(highgui_hdrs
src/precomp.hpp
${CMAKE_CURRENT_LIST_DIR}/src/precomp.hpp
)
set(highgui_srcs
src/window.cpp
${CMAKE_CURRENT_LIST_DIR}/src/window.cpp
)
file(GLOB highgui_ext_hdrs "include/opencv2/*.hpp" "include/opencv2/${name}/*.hpp" "include/opencv2/${name}/*.h")
file(GLOB highgui_ext_hdrs
"${CMAKE_CURRENT_LIST_DIR}/include/opencv2/*.hpp"
"${CMAKE_CURRENT_LIST_DIR}/include/opencv2/${name}/*.hpp"
"${CMAKE_CURRENT_LIST_DIR}/include/opencv2/${name}/*.h")
if(HAVE_QT5)
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
QT5_ADD_RESOURCES(_RCC_OUTFILES src/window_QT.qrc)
list(APPEND highgui_srcs src/window_QT.cpp src/window_QT.h ${_RCC_OUTFILES})
QT5_ADD_RESOURCES(_RCC_OUTFILES ${CMAKE_CURRENT_LIST_DIR}/src/window_QT.qrc)
list(APPEND highgui_srcs
${CMAKE_CURRENT_LIST_DIR}/src/window_QT.cpp
${CMAKE_CURRENT_LIST_DIR}/src/window_QT.h
${_RCC_OUTFILES})
foreach(dt5_dep Core Gui Widgets Test Concurrent)
add_definitions(${Qt5${dt5_dep}_DEFINITIONS})
@ -51,24 +57,24 @@ elseif(HAVE_QT)
endif()
include(${QT_USE_FILE})
QT4_ADD_RESOURCES(_RCC_OUTFILES src/window_QT.qrc)
QT4_WRAP_CPP(_MOC_OUTFILES src/window_QT.h)
QT4_ADD_RESOURCES(_RCC_OUTFILES ${CMAKE_CURRENT_LIST_DIR}/src/window_QT.qrc)
QT4_WRAP_CPP(_MOC_OUTFILES ${CMAKE_CURRENT_LIST_DIR}/src/window_QT.h)
list(APPEND HIGHGUI_LIBRARIES ${QT_LIBRARIES})
list(APPEND highgui_srcs src/window_QT.cpp ${_MOC_OUTFILES} ${_RCC_OUTFILES})
list(APPEND highgui_srcs ${CMAKE_CURRENT_LIST_DIR}/src/window_QT.cpp ${_MOC_OUTFILES} ${_RCC_OUTFILES})
ocv_check_flag_support(CXX -Wno-missing-declarations _have_flag)
if(${_have_flag})
set_source_files_properties(${_RCC_OUTFILES} PROPERTIES COMPILE_FLAGS -Wno-missing-declarations)
endif()
elseif(HAVE_WIN32UI)
list(APPEND highgui_srcs src/window_w32.cpp)
list(APPEND highgui_srcs ${CMAKE_CURRENT_LIST_DIR}/src/window_w32.cpp)
elseif(HAVE_GTK OR HAVE_GTK3)
list(APPEND highgui_srcs src/window_gtk.cpp)
list(APPEND highgui_srcs ${CMAKE_CURRENT_LIST_DIR}/src/window_gtk.cpp)
elseif(HAVE_CARBON)
list(APPEND highgui_srcs src/window_carbon.cpp)
list(APPEND highgui_srcs ${CMAKE_CURRENT_LIST_DIR}/src/window_carbon.cpp)
list(APPEND HIGHGUI_LIBRARIES "-framework Carbon" "-framework QuickTime")
elseif(HAVE_COCOA)
list(APPEND highgui_srcs src/window_cocoa.mm)
list(APPEND highgui_srcs ${CMAKE_CURRENT_LIST_DIR}/src/window_cocoa.mm)
list(APPEND HIGHGUI_LIBRARIES "-framework Cocoa")
endif()
@ -90,6 +96,7 @@ ocv_module_include_directories()
ocv_create_module(${HIGHGUI_LIBRARIES})
macro(ocv_highgui_configure_target)
if(APPLE)
ocv_check_flag_support(OBJCXX "-fobjc-exceptions" HAVE_OBJC_EXCEPTIONS)
if(HAVE_OBJC_EXCEPTIONS)
@ -116,11 +123,17 @@ if(MSVC)
set_target_properties(${the_module} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:atlthunk.lib /NODEFAULTLIB:atlsd.lib /NODEFAULTLIB:libcmt.lib /DEBUG")
endif()
#stop automatic dependencies propagation for this module
set_target_properties(${the_module} PROPERTIES LINK_INTERFACE_LIBRARIES "")
if(NOT BUILD_opencv_world)
#stop automatic dependencies propagation for this module
set_target_properties(${the_module} PROPERTIES LINK_INTERFACE_LIBRARIES "")
endif()
ocv_add_precompiled_headers(${the_module})
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wno-deprecated-declarations)
endmacro()
if(NOT BUILD_opencv_world)
ocv_highgui_configure_target()
endif()
ocv_add_accuracy_tests()
ocv_add_perf_tests()

@ -50,30 +50,34 @@ if(HAVE_OPENEXR)
list(APPEND GRFMT_LIBS ${OPENEXR_LIBRARIES})
endif()
file(GLOB grfmt_hdrs src/grfmt*.hpp)
file(GLOB grfmt_srcs src/grfmt*.cpp)
list(APPEND grfmt_hdrs src/bitstrm.hpp)
list(APPEND grfmt_srcs src/bitstrm.cpp)
list(APPEND grfmt_hdrs src/rgbe.hpp)
list(APPEND grfmt_srcs src/rgbe.cpp)
file(GLOB grfmt_hdrs ${CMAKE_CURRENT_LIST_DIR}/src/grfmt*.hpp)
file(GLOB grfmt_srcs ${CMAKE_CURRENT_LIST_DIR}/src/grfmt*.cpp)
list(APPEND grfmt_hdrs ${CMAKE_CURRENT_LIST_DIR}/src/bitstrm.hpp)
list(APPEND grfmt_srcs ${CMAKE_CURRENT_LIST_DIR}/src/bitstrm.cpp)
list(APPEND grfmt_hdrs ${CMAKE_CURRENT_LIST_DIR}/src/rgbe.hpp)
list(APPEND grfmt_srcs ${CMAKE_CURRENT_LIST_DIR}/src/rgbe.cpp)
source_group("Src\\grfmts" FILES ${grfmt_hdrs} ${grfmt_srcs})
set(imgcodecs_hdrs
src/precomp.hpp
src/utils.hpp
${CMAKE_CURRENT_LIST_DIR}/src/precomp.hpp
${CMAKE_CURRENT_LIST_DIR}/src/utils.hpp
)
set(imgcodecs_srcs
src/loadsave.cpp
src/utils.cpp
${CMAKE_CURRENT_LIST_DIR}/src/loadsave.cpp
${CMAKE_CURRENT_LIST_DIR}/src/utils.cpp
)
file(GLOB imgcodecs_ext_hdrs "include/opencv2/*.hpp" "include/opencv2/${name}/*.hpp" "include/opencv2/${name}/*.h")
file(GLOB imgcodecs_ext_hdrs
"${CMAKE_CURRENT_LIST_DIR}/include/opencv2/*.hpp"
"${CMAKE_CURRENT_LIST_DIR}/include/opencv2/${name}/*.hpp"
"${CMAKE_CURRENT_LIST_DIR}/include/opencv2/${name}/*.h"
)
if(IOS)
add_definitions(-DHAVE_IOS=1)
list(APPEND imgcodecs_srcs src/ios_conversions.mm)
list(APPEND imgcodecs_srcs ${CMAKE_CURRENT_LIST_DIR}/src/ios_conversions.mm)
list(APPEND IMGCODECS_LIBRARIES "-framework Accelerate" "-framework CoreGraphics" "-framework CoreImage" "-framework QuartzCore" "-framework AssetsLibrary")
endif()
@ -95,6 +99,7 @@ ocv_module_include_directories()
ocv_create_module(${GRFMT_LIBS} ${IMGCODECS_LIBRARIES})
macro(ocv_imgcodecs_configure_target)
if(APPLE)
ocv_check_flag_support(OBJCXX "-fobjc-exceptions" HAVE_OBJC_EXCEPTIONS)
if(HAVE_OBJC_EXCEPTIONS)
@ -124,8 +129,12 @@ endif()
#stop automatic dependencies propagation for this module
set_target_properties(${the_module} PROPERTIES LINK_INTERFACE_LIBRARIES "")
ocv_add_precompiled_headers(${the_module})
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wno-deprecated-declarations)
endmacro()
if(NOT BUILD_opencv_world)
ocv_imgcodecs_configure_target()
endif()
ocv_add_accuracy_tests()
ocv_add_perf_tests()

@ -5,7 +5,7 @@
// Copyright (C) 2014, Advanced Micro Devices, Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
#include "perf_precomp.hpp"
#include "../perf_precomp.hpp"
#include "opencv2/ts/ocl_perf.hpp"
#ifdef HAVE_OPENCL

@ -43,7 +43,7 @@
//
//M*/
#include "perf_precomp.hpp"
#include "../perf_precomp.hpp"
#include "opencv2/ts/ocl_perf.hpp"
#ifdef HAVE_OPENCL

@ -44,7 +44,7 @@
//
//M*/
#include "perf_precomp.hpp"
#include "../perf_precomp.hpp"
#include "opencv2/ts/ocl_perf.hpp"
#ifdef HAVE_OPENCL

@ -44,7 +44,7 @@
//
//M*/
#include "perf_precomp.hpp"
#include "../perf_precomp.hpp"
#include "opencv2/ts/ocl_perf.hpp"
#ifdef HAVE_OPENCL

@ -44,7 +44,7 @@
//
//M*/
#include "perf_precomp.hpp"
#include "../perf_precomp.hpp"
#include "opencv2/ts/ocl_perf.hpp"
#ifdef HAVE_OPENCL

@ -41,7 +41,7 @@
//
//M*/
#include "perf_precomp.hpp"
#include "../perf_precomp.hpp"
#include "opencv2/ts/ocl_perf.hpp"
#include <sstream>

@ -44,7 +44,7 @@
//
//M*/
#include "perf_precomp.hpp"
#include "../perf_precomp.hpp"
#include "opencv2/ts/ocl_perf.hpp"
#ifdef HAVE_OPENCL

@ -44,7 +44,7 @@
//
//M*/
#include "perf_precomp.hpp"
#include "../perf_precomp.hpp"
#include "opencv2/ts/ocl_perf.hpp"
#ifdef HAVE_OPENCL

@ -1,4 +1,4 @@
#include "perf_precomp.hpp"
#include "../perf_precomp.hpp"
#include "opencv2/ts/ocl_perf.hpp"
#ifdef HAVE_OPENCL

@ -44,7 +44,7 @@
//
//M*/
#include "perf_precomp.hpp"
#include "../perf_precomp.hpp"
#include "opencv2/ts/ocl_perf.hpp"
#ifdef HAVE_OPENCL

@ -44,7 +44,7 @@
//
//M*/
#include "perf_precomp.hpp"
#include "../perf_precomp.hpp"
#include "opencv2/ts/ocl_perf.hpp"
#ifdef HAVE_OPENCL

@ -41,7 +41,7 @@
//M*/
#include "precomp.hpp"
#include "opencl_kernels.hpp"
#include "opencl_kernels_imgproc.hpp"
namespace cv
{

@ -44,7 +44,7 @@
//M*/
#include "precomp.hpp"
#include "opencl_kernels.hpp"
#include "opencl_kernels_imgproc.hpp"
namespace cv {

@ -40,7 +40,7 @@
//M*/
#include "precomp.hpp"
#include "opencl_kernels.hpp"
#include "opencl_kernels_imgproc.hpp"
#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7)

@ -40,7 +40,7 @@
//M*/
#include "precomp.hpp"
#include "opencl_kernels.hpp"
#include "opencl_kernels_imgproc.hpp"
// ----------------------------------------------------------------------
// CLAHE

@ -90,7 +90,7 @@
\**********************************************************************************/
#include "precomp.hpp"
#include "opencl_kernels.hpp"
#include "opencl_kernels_imgproc.hpp"
#include <limits>
#define CV_DESCALE(x,n) (((x) + (1 << ((n)-1))) >> (n))

@ -41,7 +41,7 @@
//M*/
#include "precomp.hpp"
#include "opencl_kernels.hpp"
#include "opencl_kernels_imgproc.hpp"
namespace cv
{

@ -41,7 +41,7 @@
//M*/
#include "precomp.hpp"
#include "opencl_kernels.hpp"
#include "opencl_kernels_imgproc.hpp"
#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7)
static IppStatus sts = ippInit();

@ -40,7 +40,7 @@
//M*/
#include "precomp.hpp"
#include "opencl_kernels.hpp"
#include "opencl_kernels_imgproc.hpp"
#include <cstdio>
#include <vector>

@ -41,7 +41,7 @@
//M*/
#include "precomp.hpp"
#include "opencl_kernels.hpp"
#include "opencl_kernels_imgproc.hpp"
/****************************************************************************************\
Base Image Filter

@ -40,7 +40,7 @@
//M*/
#include "precomp.hpp"
#include "opencl_kernels.hpp"
#include "opencl_kernels_imgproc.hpp"
namespace cv
{

@ -47,7 +47,7 @@
// */
#include "precomp.hpp"
#include "opencl_kernels.hpp"
#include "opencl_kernels_imgproc.hpp"
#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7)
static IppStatus sts = ippInit();

@ -39,7 +39,7 @@
//
//M*/
#include "precomp.hpp"
#include "opencl_kernels.hpp"
#include "opencl_kernels_imgproc.hpp"
namespace cv
{

@ -42,7 +42,7 @@
#include "precomp.hpp"
#include <limits.h>
#include "opencl_kernels.hpp"
#include "opencl_kernels_imgproc.hpp"
/****************************************************************************************\
Basic Morphological Operations: Erosion & Dilation

@ -41,7 +41,7 @@
//M*/
#include "precomp.hpp"
#include "opencl_kernels.hpp"
#include "opencl_kernels_imgproc.hpp"
namespace cv
{

@ -41,7 +41,7 @@
//M*/
#include "precomp.hpp"
#include "opencl_kernels.hpp"
#include "opencl_kernels_imgproc.hpp"
/*
* This file includes the code, contributed by Simon Perreault

@ -41,7 +41,7 @@
//M*/
#include "precomp.hpp"
#include "opencl_kernels.hpp"
#include "opencl_kernels_imgproc.hpp"
#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7)
static IppStatus sts = ippInit();

@ -40,7 +40,7 @@
//M*/
#include "precomp.hpp"
#include "opencl_kernels.hpp"
#include "opencl_kernels_imgproc.hpp"
////////////////////////////////////////////////// matchTemplate //////////////////////////////////////////////////////////

@ -41,7 +41,7 @@
//M*/
#include "precomp.hpp"
#include "opencl_kernels.hpp"
#include "opencl_kernels_imgproc.hpp"
namespace cv
{

@ -43,7 +43,7 @@
//
//M*/
#include "test_precomp.hpp"
#include "../test_precomp.hpp"
#include "cvconfig.h"
#include "opencv2/ts/ocl_test.hpp"

@ -43,7 +43,7 @@
//
//M*/
#include "test_precomp.hpp"
#include "../test_precomp.hpp"
#include "cvconfig.h"
#include "opencv2/ts/ocl_test.hpp"

@ -41,7 +41,7 @@
//
//M*/
#include "test_precomp.hpp"
#include "../test_precomp.hpp"
#include "opencv2/ts/ocl_test.hpp"
#ifdef HAVE_OPENCL

@ -43,7 +43,7 @@
//
//M*/
#include "test_precomp.hpp"
#include "../test_precomp.hpp"
#include "opencv2/ts/ocl_test.hpp"
#ifdef HAVE_OPENCL

@ -43,7 +43,7 @@
//
//M*/
#include "test_precomp.hpp"
#include "../test_precomp.hpp"
#include "opencv2/ts/ocl_test.hpp"
#ifdef HAVE_OPENCL

@ -41,7 +41,7 @@
//
//M*/
#include "test_precomp.hpp"
#include "../test_precomp.hpp"
#include "opencv2/ts/ocl_test.hpp"
#ifdef HAVE_OPENCL

@ -48,7 +48,7 @@
//
//M*/
#include "test_precomp.hpp"
#include "../test_precomp.hpp"
#include "cvconfig.h"
#include "opencv2/ts/ocl_test.hpp"

@ -41,7 +41,7 @@
//
//M*/
#include "test_precomp.hpp"
#include "../test_precomp.hpp"
#include "opencv2/ts/ocl_test.hpp"
#ifdef HAVE_OPENCL

@ -52,7 +52,7 @@
//
//M*/
#include "test_precomp.hpp"
#include "../test_precomp.hpp"
#include "cvconfig.h"
#include "opencv2/ts/ocl_test.hpp"

@ -51,7 +51,7 @@
//
//M*/
#include "test_precomp.hpp"
#include "../test_precomp.hpp"
#include "cvconfig.h"
#include "opencv2/ts/ocl_test.hpp"

@ -41,7 +41,7 @@
//
//M*/
#include "test_precomp.hpp"
#include "../test_precomp.hpp"
#include "opencv2/ts/ocl_test.hpp"
#include "iostream"
#include "fstream"

@ -41,7 +41,7 @@
//
//M*/
#include "test_precomp.hpp"
#include "../test_precomp.hpp"
#include "opencv2/ts/ocl_test.hpp"
#ifdef HAVE_OPENCL

@ -44,7 +44,7 @@
//M*/
#include "test_precomp.hpp"
#include "../test_precomp.hpp"
#include "opencv2/ts/ocl_test.hpp"
#ifdef HAVE_OPENCL

@ -41,7 +41,7 @@
//
//M*/
#include "test_precomp.hpp"
#include "../test_precomp.hpp"
#include "opencv2/ts/ocl_test.hpp"
#ifdef HAVE_OPENCL

@ -51,7 +51,7 @@
//
//M*/
#include "test_precomp.hpp"
#include "../test_precomp.hpp"
#include "opencv2/ts/ocl_test.hpp"
#ifdef HAVE_OPENCL

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save